summaryrefslogtreecommitdiff
path: root/modules/organize/js/organize.js
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-04-22 23:23:15 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-04-22 23:23:15 +0000
commit933770cf0ece55ff98a098456807764caf07b767 (patch)
treec2ba4e022dd58fb988f8bf7b2f406c8e9640d784 /modules/organize/js/organize.js
parent79712cb0b4c73e8bc73f4f694018fb2e6308c935 (diff)
1) Fix index overflow issue.
2) Fix where the microthumb was removed even if the move was cancelled
Diffstat (limited to 'modules/organize/js/organize.js')
-rw-r--r--modules/organize/js/organize.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js
index 75d5ccd2..4ca7e844 100644
--- a/modules/organize/js/organize.js
+++ b/modules/organize/js/organize.js
@@ -115,18 +115,22 @@ var treeDroppable = {
var targetItemId = $(this).attr("ref");
if ($(this).hasClass("gBranchSelected")) {
// @todo Error message for moving onto self
+ ui.draggable.trigger("stop", event);
return false;
}
var okToMove = true;
$("#gDragHelper li").each(function(i) {
moveItems += "&item[]=" + $(this).attr("ref");
okToMove &= targetItemId != $(this).attr("ref");
- $("#thumb_" + $(this).attr("ref")).remove();
});
if (!okToMove) {
// @todo Error message for moving onto self
+ ui.draggable.trigger("stop", event);
return false;
}
+ $("#gDragHelper li").each(function(i) {
+ $("#thumb_" + $(this).attr("ref")).remove();
+ });
$.ajax({
data: moveItems,
dataType: "json",