1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
$(function () {
$(".list_a, .list_b").selectable({
cancel: ".sort-handle"
}).sortable({
connectWith: ".connectedSortable",
handle: ".sort-handle",
placeholder: "portlet-placeholder ui-corner-all",
helper: function (e, item) {
var helper = $("<li/>");
if (!item.hasClass("ui-selected"))
{
item.parent().children(".ui-selected").removeClass("ui-selected");
item.addClass("ui-selected");
}
var selected = item.parent().children(".ui-selected").clone();
item.data("multidrag", selected).siblings(".ui-selected").remove();
return helper.append(selected);
},
stop: function (e, ui) {
var selected = ui.item.data("multidrag");
ui.item.after(selected);
ui.item.remove();
}
}); |