From 8c5064a3305bc1432f7e3840bdea906de76d2a71 Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 30 Apr 2014 18:36:49 +0000 Subject: 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 --- admin/themes/default/template/include/tag_selection.inc.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'admin/themes/default/template/include/tag_selection.inc.tpl') diff --git a/admin/themes/default/template/include/tag_selection.inc.tpl b/admin/themes/default/template/include/tag_selection.inc.tpl index 680c6b85e..e84ec2431 100644 --- a/admin/themes/default/template/include/tag_selection.inc.tpl +++ b/admin/themes/default/template/include/tag_selection.inc.tpl @@ -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'); } }); }); -- cgit v1.2.3