Dotclear


Ignore:
Timestamp:
08/27/13 11:42:56 (12 years ago)
Author:
Lepeltier kévin
Branch:
Ticket #1604
Message:

Ticket #1604 progression

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/widgets/dragdrop.js

    r1649 r1650  
    1616          connectWith: ".connected, .sortable-delete", 
    1717          start: function( event, ui ) { 
    18                ui.item.css('left', ui.item.position().left + 30); 
     18               // petit décalage éstétique 
     19               ui.item.css('left', ui.item.position().left + 20); 
    1920          }, 
    2021          update: function(event, ui) { 
    2122                
    22                // mes a zéro le décalage 
     23               ul = $(this); 
     24               widget = ui.item; 
     25               field = ul.parents('.widgets'); 
     26                
     27               // met a zéro le décalage 
    2328               ui.item.css('left', 'auto'); 
    2429                
    25                if( $(this).find('li').length == 0 ) { 
    26                     $(this).parents('.widgets').find('.empty-widgets').show(); 
    27                } else { 
    28                     $(this).parents('.widgets').find('.empty-widgets').hide(); 
     30               // signale les zone vide 
     31               if( ul.find('li').length == 0 ) 
     32                     field.find('.empty-widgets').show(); 
     33               else field.find('.empty-widgets').hide(); 
     34                
     35               // remove 
     36               if( widget.parents('ul').is('.sortable-delete') ) { 
     37                    widget.hide('slow', function() { 
     38                         $(this).remove(); 
     39                    }); 
    2940               } 
    3041                
    3142               // réordonne 
    32                if( $(this).attr('id') ) { 
    33                     $(this).find('input[title=ordre]').each(function(i){ 
    34                          tab = $(this).val(i); 
     43               if( ul.attr('id') ) { 
     44                    ul.find('li').each(function(i) { 
     45                          
     46                         // trouve la zone de récéption 
     47                         var name = ul.attr('id').split('dnd').join(''); 
     48                          
     49                         // modifie le name en conséquence 
     50                         $(this).find('*[name^=w]').each(function(){ 
     51                              tab = $(this).attr('name').split(']['); 
     52                              tab[0] = "w["+name; 
     53                              tab[1] = i; 
     54                              $(this).attr('name', tab.join('][')); 
     55                         }); 
     56                          
     57                         // ainssi que le champ d'ordre sans js (au cas ou) 
     58                         $(this).find('input[title=ordre]').val(i); 
     59                          
    3560                    }); 
    3661               } 
    3762                
    38                // switch 
    39                if( $(this).attr('id') != ui.item.parents('ul').attr('id') ) { 
    40                     //oldname = $(this).attr('id').split('dnd').join(''); 
    41                     var name = ui.item.parents('ul').attr('id').split('dnd').join(''); 
    42                     ui.item.find('*[name^=w]').each(function(){ 
    43                          tab = $(this).attr('name').split(']['); 
    44                          tab[0] = "w["+name; 
    45                          $(this).attr('name', tab.join('][')); 
    46                     }); 
     63               // expand 
     64               if(widget.find('img.expand').length == 0) { 
     65                    dotclear.postExpander(widget); 
     66                    dotclear.viewPostContent(widget, 'close'); 
    4767               } 
    4868                
    49           } //, 
    50           //change: function( event, ui ) { 
    51                //ui.helper.css('height', $('#dndnav .widget-name').css('height')); 
    52           //} 
     69          } 
    5370     }); 
    5471      
     
    6279          start: function( event, ui ) { 
    6380               ui.helper.css({'width': $('#widgets > li').css('width')}); 
    64                //ui.helper.css({'min-height': $('#dndnav .widget-name').css('height')}); 
    65                //ui.helper.find('.form-note').hide(); 
    66                //ui.helper.find('.widget-name').css({'min-height': $('#dndnav .widget-name').css('height')}); 
    6781          } 
    6882     }); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map