| | |
| | | tree_state, |
| | | ui_droppable, |
| | | ui_draggable, |
| | | draggable_opts, |
| | | droppable_opts, |
| | | list_id = (container.attr('id') || p.id_prefix || '0'), |
| | | me = this; |
| | | |
| | |
| | | /** |
| | | * |
| | | */ |
| | | function reset() |
| | | function reset(keep_content) |
| | | { |
| | | select(''); |
| | | |
| | |
| | | indexbyid = {}; |
| | | drag_active = false; |
| | | |
| | | container.html(''); |
| | | if (keep_content) { |
| | | if (draggable_opts) { |
| | | if (ui_draggable) |
| | | draggable('destroy'); |
| | | draggable(draggable_opts); |
| | | } |
| | | |
| | | if (droppable_opts) { |
| | | if (ui_droppable) |
| | | droppable('destroy'); |
| | | droppable(droppable_opts); |
| | | } |
| | | |
| | | update_data(); |
| | | } |
| | | else { |
| | | container.html(''); |
| | | } |
| | | |
| | | reset_search(); |
| | | } |
| | |
| | | { |
| | | if (!opts) opts = {}; |
| | | |
| | | if ($.type(opts) == 'string') { |
| | | if (opts == 'destroy') { |
| | | ui_droppable = null; |
| | | } |
| | | $('li:not(.virtual)', container).droppable(opts); |
| | | return this; |
| | | } |
| | | |
| | | droppable_opts = opts; |
| | | |
| | | var my_opts = $.extend({ |
| | | greedy: true, |
| | | tolerance: 'pointer', |
| | |
| | | { |
| | | if (!opts) opts = {}; |
| | | |
| | | if ($.type(opts) == 'string') { |
| | | if (opts == 'destroy') { |
| | | ui_draggable = null; |
| | | } |
| | | $('li:not(.virtual)', container).draggable(opts); |
| | | return this; |
| | | } |
| | | |
| | | draggable_opts = opts; |
| | | |
| | | var my_opts = $.extend({ |
| | | appendTo: 'body', |
| | | revert: 'invalid', |
| | | 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())); |