summaryrefslogtreecommitdiff
path: root/modules/rearrange/js
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-12-04 20:05:58 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-12-04 20:05:58 +0000
commit0f103b1c069063a2e6109a0ba7e566104f4ba8fa (patch)
tree8b7e26b0ef3650a6b90c0b9602da6b37bf3437f3 /modules/rearrange/js
parent80a7db61c9fba53477c1ec0850bdffaf7b11657a (diff)
Moving albums around with a drag and drop interface seems to work and preserve the left right pointers.
* changed _lock and _unlock to protected methods lock and lock respectively * added a moveTo method on the Item_Model * Corrected the hole closure on delete. * added moveTo on the ORM_MTPP class * Changed the rearrange javascript to do moves with ajax
Diffstat (limited to 'modules/rearrange/js')
-rw-r--r--modules/rearrange/js/jquery.gallery.rearrange.tree.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/modules/rearrange/js/jquery.gallery.rearrange.tree.js b/modules/rearrange/js/jquery.gallery.rearrange.tree.js
index 09284a25..c423becd 100644
--- a/modules/rearrange/js/jquery.gallery.rearrange.tree.js
+++ b/modules/rearrange/js/jquery.gallery.rearrange.tree.js
@@ -70,9 +70,19 @@ if(jQuery) (function($){
hoverClass: "droppable-hover",
drop: function(ev, ui) {
source_element = ui.draggable;
- source_parent = source_element.parent();
+ source_parent = getParent(source_element);
target = ui.element;
- alert(source_element.attr("id") + "\n" + target.attr("id"));
+
+ $.ajax({
+ url: "rearrange/move/" + source_element.attr("id") + "/" + target.attr("id"),
+ success: function(data, textStatus) {
+ collapse(source_parent);
+ showTree(source_parent, source_parent.attr("id"));
+ },
+ error: function(xhr, textStatus, errorThrown) {
+ alert("Http Error Code: " + xhr.status + "Text Status: " + textStatus);
+ }
+ });
}
});
bindTree(c);
@@ -168,9 +178,7 @@ if(jQuery) (function($){
showTree(parent, parent.attr("id"));
},
error: function(xhr, textStatus, errorThrown) {
- alert(xhr.status);
- alert(textStatus);
- alert(errorThrown);
+ alert("Http Error Code: " + xhr.status + "Text Status: " + textStatus);
},
type: "DELETE"
});