Revision 1648:2eee4ee2798e,
1.2 KB
checked in by Lepeltier kévin, 11 years ago
(diff) |
Ticket #1604
remplacement des div par des ul li
Ajout de draggable dans jQuery ui
Ajout de sortable et draggable version ui il manque la supression
L'avertissement "No widget" est permanent, mais masqué par js ('display none') je suppose que ça va pas le faire avec a11y
|
Line | |
---|
1 | $(function() { |
---|
2 | |
---|
3 | // clean |
---|
4 | $('.js-remove').remove(); |
---|
5 | $('.js-hide').hide(); |
---|
6 | $('.widgetSettings').hide(); |
---|
7 | |
---|
8 | // move |
---|
9 | $( ".connected" ).sortable({ |
---|
10 | axis: "y", |
---|
11 | connectWith: ".connected", |
---|
12 | cursor: "move", |
---|
13 | stop: function( event, ui ) { |
---|
14 | $('.connected').each(function(){ |
---|
15 | if( $(this).find('li').length == 0 ) { |
---|
16 | $(this).parents('.widgets').find('.empty-widgets').show(); |
---|
17 | } else { |
---|
18 | $(this).parents('.widgets').find('.empty-widgets').hide(); |
---|
19 | } |
---|
20 | }); |
---|
21 | }//, |
---|
22 | //change: function( event, ui ) { |
---|
23 | //ui.helper.css('height', $('#dndnav .widget-name').css('height')); |
---|
24 | //} |
---|
25 | }); |
---|
26 | |
---|
27 | // add |
---|
28 | $( "#widgets > li" ).draggable({ |
---|
29 | connectToSortable: ".connected", |
---|
30 | helper: "clone", |
---|
31 | revert: "invalid", |
---|
32 | cursor: "move", |
---|
33 | start: function( event, ui ) { |
---|
34 | ui.helper.css({'width': $('#widgets > li').css('width')}); |
---|
35 | //ui.helper.css({'min-height': $('#dndnav .widget-name').css('height')}); |
---|
36 | //ui.helper.find('.form-note').hide(); |
---|
37 | //ui.helper.find('.widget-name').css({'min-height': $('#dndnav .widget-name').css('height')}); |
---|
38 | }/*, |
---|
39 | stop: function( event, ui ) { |
---|
40 | $('.empty-widgets').css('display', 'none'); |
---|
41 | }*/ |
---|
42 | }); |
---|
43 | |
---|
44 | $( "#widgets, .connected" ).disableSelection(); |
---|
45 | |
---|
46 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.