Changeset 1650:d62b141eeae6 for plugins/widgets/dragdrop.js
- Timestamp:
- 08/27/13 11:42:56 (11 years ago)
- Branch:
- Ticket #1604
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/widgets/dragdrop.js
r1649 r1650 16 16 connectWith: ".connected, .sortable-delete", 17 17 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); 19 20 }, 20 21 update: function(event, ui) { 21 22 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 23 28 ui.item.css('left', 'auto'); 24 29 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 }); 29 40 } 30 41 31 42 // 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 35 60 }); 36 61 } 37 62 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'); 47 67 } 48 68 49 } //, 50 //change: function( event, ui ) { 51 //ui.helper.css('height', $('#dndnav .widget-name').css('height')); 52 //} 69 } 53 70 }); 54 71 … … 62 79 start: function( event, ui ) { 63 80 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')});67 81 } 68 82 });
Note: See TracChangeset
for help on using the changeset viewer.