admin tag selection use event delegation (faster load time with large number of tags)

git-svn-id: http://piwigo.org/svn/trunk@28317 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2014-04-30 18:36:49 +00:00
parent fc20ee6b69
commit 8c5064a330
@@ -1,14 +1,14 @@
{footer_script require='jquery'}{literal}
jQuery(document).ready(function(){
jQuery(".tagSelection label").click(function () {
jQuery(".tagSelection").on("click", "label", function () {
var parent = jQuery(this).parent('li');
var checkbox = jQuery(this).children("input[type=checkbox]");
if (jQuery(checkbox).is(':checked')) {
jQuery(parent).addClass("tagSelected");
parent.addClass("tagSelected");
}
else {
jQuery(parent).removeClass('tagSelected');
parent.removeClass('tagSelected');
}
});
});