Dotclear

Changeset 1563:f219d9220033 for admin/js


Ignore:
Timestamp:
08/24/13 14:31:03 (11 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

Issue #1541: no combo box because only one action
deletion works without javascript (category that can received entries is not hidden)

Location:
admin/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/js/_categories.js

    r1551 r1563  
    1818     }); 
    1919 
    20      $('#mov_cat').parent().hide(); 
    21      $('input[name="categories[]"]').click(function() { 
    22           if ($('input[name="categories[]"].notempty:checked').length>0) { 
    23                $('#mov_cat').parent().show().parent().removeClass('two-cols').addClass('three-cols'); 
    24           } else { 
    25                $('#mov_cat').parent().hide().parent().removeClass('three-cols').addClass('two-cols'); 
    26           } 
    27      }); 
    28  
    2920     dotclear.categoriesActionsHelper(); 
    3021 
  • admin/js/common.js

    r1556 r1563  
    304304     categoriesActionsHelper: function() { 
    305305          $('#form-categories').submit(function() { 
    306                var action = $(this).find('select[name="action"]').val(); 
    307                var checked = false; 
    308  
    309                $(this).find('input[name="categories[]"]').each(function() { 
    310                     if (this.checked) { 
    311                          checked = true; 
    312                     } 
    313                }); 
    314  
    315                if (!checked) { return false; } 
    316  
    317                if (action == 'delete') { 
    318                     return window.confirm(dotclear.msg.confirm_delete_categories.replace('%s',$('input[name="categories[]"]:checked').size())); 
    319                } 
    320  
    321                return true; 
     306              var nb_ckecked = $('input[name="categories[]"]:checked').length; 
     307              if (nb_ckecked==0) { 
     308               return false; 
     309              } 
     310 
     311              return window.confirm(dotclear.msg.confirm_delete_categories.replace('%s',nb_ckecked)); 
    322312          }); 
    323313     }, 
Note: See TracChangeset for help on using the changeset viewer.

Sites map