Dotclear


Ignore:
Timestamp:
10/02/13 12:05:46 (12 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Allow checkboxesHelpers to manage checkboxes added dynamically
Add jasmine tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/js/common.js

    r2187 r2200  
    280280          $(e).append(document.createTextNode(' ')); 
    281281 
    282           target = target || $(e).parents('form').find('input[type="checkbox"]'); 
    283            
    284           var a = document.createElement('a'); 
    285           a.href='#'; 
    286           $(a).append(document.createTextNode(dotclear.msg.select_all)); 
    287           a.onclick = function() { 
     282          $('<a href="#">'+dotclear.msg.select_all+'</a>').click(function() { 
     283               if (target === undefined) { 
     284                    target = $(e).parents('form').find('input[type="checkbox"]'); 
     285               } 
    288286               target.check(); 
    289287               return false; 
    290           }; 
    291           $(e).append(a); 
    292  
     288          }).appendTo($(e)); 
    293289          $(e).append(document.createTextNode(' | ')); 
    294290 
    295           a = document.createElement('a'); 
    296           a.href='#'; 
    297           $(a).append(document.createTextNode(dotclear.msg.no_selection)); 
    298           a.onclick = function() { 
     291          $('<a href="#">'+dotclear.msg.no_selection+'</a>').click(function() { 
     292               if (target === undefined) { 
     293                    target = $(e).parents('form').find('input[type="checkbox"]'); 
     294               } 
    299295               target.unCheck(); 
    300296               return false; 
    301           }; 
    302           $(e).append(a); 
    303  
     297          }).appendTo($(e)); 
    304298          $(e).append(document.createTextNode(' - ')); 
    305299 
    306           a = document.createElement('a'); 
    307           a.href='#'; 
    308           $(a).append(document.createTextNode(dotclear.msg.invert_sel)); 
    309           a.onclick = function() { 
     300          $('<a href="#">'+dotclear.msg.invert_sel+'</a>').click(function() { 
     301               if (target === undefined) { 
     302                    target = $(e).parents('form').find('input[type="checkbox"]'); 
     303               } 
    310304               target.toggleCheck(); 
    311305               return false; 
    312           }; 
    313           $(e).append(a); 
     306          }).appendTo($(e)); 
    314307     }, 
    315308 
Note: See TracChangeset for help on using the changeset viewer.

Sites map