summaryrefslogtreecommitdiff
path: root/themes/admin_default/js/ui.init.js
diff options
context:
space:
mode:
Diffstat (limited to 'themes/admin_default/js/ui.init.js')
-rw-r--r--themes/admin_default/js/ui.init.js41
1 files changed, 22 insertions, 19 deletions
diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js
index 68c6398d..da01c96e 100644
--- a/themes/admin_default/js/ui.init.js
+++ b/themes/admin_default/js/ui.init.js
@@ -31,23 +31,26 @@ $(document).ready(function(){
}});
// Sortable dashboard blocks
- $("#gContent").sortable({
- connectWith: ["#gSidebar"],
- cursor: "move",
- opacity: 0.7,
- placeholder: "gBlock",
- update: function(){
- console.log($(this).sortable("serialize"));
- }
- });
- $("#gSidebar").sortable({
- connectWith: ["#gContent"],
- containment: "document",
- cursor: "move",
- opacity: 0.7,
- placeholder: "gBlock",
- update: function(){
- console.log($(this).sortable("serialize"));
- }
- });
+ if ($(".ui-dialog-titlebar-close").length) {
+ $(".gBlock *:first").addClass("gDraggable");
+ $("#gContent").sortable({
+ connectWith: ["#gSidebar"],
+ cursor: "move",
+ handle: $("div:first"),
+ opacity: 0.6,
+ placeholder: "gDropTarget",
+ update: function() { console.log($(this).sortable("serialize")); }
+ // @todo stop: function() { .ajax() }
+ });
+ $("#gSidebar").sortable({
+ connectWith: ["#gContent"],
+ containment: "document",
+ cursor: "move",
+ handle: $("div:first"),
+ opacity: 0.6,
+ placeholder: "gDropTarget",
+ update: function() { console.log($(this).sortable("serialize")); }
+ // @todo stop: function() { .ajax() }
+ });
+ }
});