source: trunk/admin/themes/default/template/include/tag_selection.inc.tpl @ 28317

Last change on this file since 28317 was 28317, checked in by rvelices, 10 years ago

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

File size: 433 bytes
Line 
1{footer_script require='jquery'}{literal}
2jQuery(document).ready(function(){
3  jQuery(".tagSelection").on("click", "label", function () {
4    var parent = jQuery(this).parent('li');
5    var checkbox = jQuery(this).children("input[type=checkbox]");
6
7    if (jQuery(checkbox).is(':checked')) {
8      parent.addClass("tagSelected");
9    }
10    else {
11      parent.removeClass('tagSelected');
12    }
13  });
14});
15{/literal}{/footer_script}
Note: See TracBrowser for help on using the repository browser.