Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 1483130

Browse files
committed
ENH: Refs #223. Fixed incorrectly displayed folder structure after the drop operation.
Fixed the incorrectly indentations after the drop operation.
1 parent c40fe40 commit 1483130

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

core/public/js/community/community.manage.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ function initDragAndDrop()
169169
if(jsonResponse[0])
170170
{
171171
createNotive(jsonResponse[1],1500);
172-
$($(ui.draggable).parents("tr")).appendBranchTo(destination_obj);
173-
$(from_obj).reload();
174-
$(destination_obj).reload();
172+
$($(ui.draggable).parents("tr")).appendBranchTo(destination_obj);
175173
}
176174
else
177175
{

core/public/js/layout/jquery.treeTable.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,17 @@
5151
};
5252

5353
// Recursively hide all node's children in a tree
54-
$.fn.collapse = function() {
55-
var id = $(this).attr('id');
56-
$('tr[id*="'+id+'"]').addClass("collapsed").hide();
57-
$(this).show();
54+
$.fn.collapse = function() {
55+
$(this).addClass("collapsed");
56+
57+
childrenOf($(this)).each(function() {
58+
if(!$(this).hasClass("collapsed")) {
59+
$(this).collapse();
60+
}
61+
62+
this.style.display = "none"; // Performance! $(this).hide() is slow...
63+
});
64+
5865
colorLines(true);
5966
return this;
6067
};
@@ -201,8 +208,17 @@
201208

202209
node.addClass(options.childPrefix + destination.id);
203210
move(node, destination); // Recursively move nodes to new location
204-
var padding = getPaddingLeft(destination) + options.indent;
211+
// adjust node's padding'
212+
var cell = $($(destination).children("td")[options.treeColumn]);
213+
var padding = getPaddingLeft(cell) + options.indent;
205214
node.children("td:first")[options.treeColumn].style.paddingLeft = (padding-12) + "px";
215+
// adust node's children's padding'
216+
var childPaddingLeft = padding - 12 + options.indent;
217+
var arrayCell=childrenOf(node);
218+
if(arrayCell==null)return;
219+
arrayCell.each(function(){
220+
$(this).children("td:first")[options.treeColumn].style.paddingLeft = (childPaddingLeft-12) + "px";
221+
});
206222
}
207223

208224
return this;

core/public/js/user/user.manage.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,7 @@ function initDragAndDrop()
114114
if(jsonResponse[0])
115115
{
116116
createNotive(jsonResponse[1],1500);
117-
$($(ui.draggable).parents("tr")[0]).appendBranchTo(destination_obj);
118-
$(from_obj).reload();
119-
$(destination_obj).reload();
117+
$($(ui.draggable).parents("tr")[0]).appendBranchTo(destination_obj);
120118
}
121119
else
122120
{
@@ -146,6 +144,7 @@ function initDragAndDrop()
146144
}
147145
});
148146

147+
// qtip pop-up for folders with only read permission
149148
$(this).parents("tr:[policy=0]").qtip({
150149
content: 'You do not have write permission on this folder and cannot drop item(s) to it !',
151150
show: 'mouseover',

0 commit comments

Comments
 (0)