mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-13 00:50:27 +00:00
34 lines
1.2 KiB
JavaScript
34 lines
1.2 KiB
JavaScript
var PortletDraggable = function () {
|
|
|
|
return {
|
|
//main function to initiate the module
|
|
init: function () {
|
|
|
|
if (!jQuery().sortable) {
|
|
return;
|
|
}
|
|
|
|
$("#sortable_portlets").sortable({
|
|
connectWith: ".portlet",
|
|
items: ".portlet",
|
|
opacity: 0.8,
|
|
handle : '.portlet-title',
|
|
coneHelperSize: true,
|
|
placeholder: 'portlet-sortable-placeholder',
|
|
forcePlaceholderSize: true,
|
|
tolerance: "pointer",
|
|
helper: "clone",
|
|
tolerance: "pointer",
|
|
forcePlaceholderSize: !0,
|
|
helper: "clone",
|
|
cancel: ".portlet-sortable-empty, .portlet-fullscreen", // cancel dragging if portlet is in fullscreen mode
|
|
revert: 250, // animation in milliseconds
|
|
update: function(b, c) {
|
|
if (c.item.prev().hasClass("portlet-sortable-empty")) {
|
|
c.item.prev().before(c.item);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
};
|
|
}(); |