Ignore:
Timestamp:
Apr 30, 2014, 8:36:49 PM (11 years ago)
Author:
rvelices
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/include/tag_selection.inc.tpl

    r9586 r28317  
    11{footer_script require='jquery'}{literal}
    22jQuery(document).ready(function(){
    3   jQuery(".tagSelection label").click(function () {
     3  jQuery(".tagSelection").on("click", "label", function () {
    44    var parent = jQuery(this).parent('li');
    55    var checkbox = jQuery(this).children("input[type=checkbox]");
    66
    77    if (jQuery(checkbox).is(':checked')) {
    8       jQuery(parent).addClass("tagSelected");
     8      parent.addClass("tagSelected");
    99    }
    1010    else {
    11       jQuery(parent).removeClass('tagSelected');
     11      parent.removeClass('tagSelected');
    1212    }
    1313  });
Note: See TracChangeset for help on using the changeset viewer.