From 933770cf0ece55ff98a098456807764caf07b767 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 22 Apr 2009 23:23:15 +0000 Subject: 1) Fix index overflow issue. 2) Fix where the microthumb was removed even if the move was cancelled --- modules/organize/js/organize.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/organize/js/organize.js') 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", -- cgit v1.2.3