Fix drag-n-drop after folder move/create (#1489648)
| | |
| | | if (!this.gui_objects.subscriptionlist) |
| | | return false; |
| | | |
| | | // disable drag-n-drop temporarily |
| | | this.subscription_list.draggable('destroy').droppable('destroy'); |
| | | |
| | | var row, n, tmp, tmp_name, rowid, collator, pos, p, parent = '', |
| | | folders = [], list = [], slist = [], |
| | | list_element = $(this.gui_objects.subscriptionlist); |
| | |
| | | |
| | | if (keep_content) { |
| | | if (draggable_opts) { |
| | | draggable('destroy'); |
| | | if (ui_draggable) |
| | | draggable('destroy'); |
| | | draggable(draggable_opts); |
| | | } |
| | | |
| | | if (droppable_opts) { |
| | | droppable('destroy'); |
| | | if (ui_droppable) |
| | | droppable('destroy'); |
| | | droppable(droppable_opts); |
| | | } |
| | | |
| | |
| | | if (!opts) opts = {}; |
| | | |
| | | if ($.type(opts) == 'string') { |
| | | if (opts == 'destroy') { |
| | | ui_droppable = null; |
| | | } |
| | | $('li:not(.virtual)', container).droppable(opts); |
| | | return this; |
| | | } |
| | |
| | | if (!opts) opts = {}; |
| | | |
| | | if ($.type(opts) == 'string') { |
| | | if (opts == 'destroy') { |
| | | ui_draggable = null; |
| | | } |
| | | $('li:not(.virtual)', container).draggable(opts); |
| | | return this; |
| | | } |
| | |
| | | iframeFix: true, |
| | | addClasses: false, |
| | | cursorAt: {left: -20, top: 5}, |
| | | create: function(e, ui) { ui_draggable = ui; }, |
| | | helper: function(e) { |
| | | return $('<div>').attr('id', 'rcmdraglayer') |
| | | .text($.trim($(e.target).first().text())); |