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

Commit 6a2e74f

Browse files
author
Charles Marion
committed
BUG: Fixed item drag and drop and fixed create folder
1 parent 967a26d commit 6a2e74f

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ function initDragAndDrop()
147147
{
148148
createNotive(jsonResponse[1],1500);
149149
$($(ui.draggable).parents("tr")).appendBranchTo(destination_obj);
150+
$(destination_obj).reload();
150151
}
151152
else
152153
{

core/public/js/folder/folder.createfolder.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ function successCreateFolder(responseText, statusText, xhr, form)
3737
var node=$('table.treeTable tr[element='+jsonResponse[2].folder_id+']');
3838
if(node.length>0)
3939
{
40-
node.each(function(){
41-
childrenOf($(this)).remove();
42-
});
43-
node.attr('ajax',jsonResponse[2].folder_id);
44-
node.removeAttr('proccessing');
40+
node.reload();
4541
}
4642
}
4743
else

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

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
// Recursively hide all node's children in a tree
5454
$.fn.collapse = function() {
5555
$(this).addClass("collapsed");
56-
5756
childrenOf($(this)).each(function() {
5857
if(!$(this).hasClass("collapsed")) {
5958
$(this).collapse();
@@ -93,7 +92,7 @@
9392
{
9493
$.post(json.global.webroot+'/browse/getfolderscontent',{folders: folders} , function(data) {
9594
arrayElement=jQuery.parseJSON(data);
96-
$.each(arrayElement, function(index, value) {
95+
$.each(arrayElement, function(index, value) {
9796
tree[index]=value;
9897
});
9998
children.each(function()
@@ -111,6 +110,27 @@
111110
getElementsSize();
112111
}
113112

113+
$.fn.reload = function (){
114+
$(this).each(function(){
115+
childrenOf($(this)).remove();
116+
});
117+
tree[$(this).attr('element')]=null;
118+
var obj= $(this);
119+
$(this).removeAttr('proccessing');
120+
$(this).attr('ajax',$(this).attr('element'));
121+
$(this).expand();
122+
$.post(json.global.webroot+'/browse/getfolderscontent',{folders: $(this).attr('element')} , function(data) {
123+
arrayElement=jQuery.parseJSON(data);
124+
$.each(arrayElement, function(index, value) {
125+
tree[index]=value;
126+
});
127+
createElementsAjax(obj,tree[obj.attr('element')],true);
128+
initEvent();
129+
getElementsSize();
130+
});
131+
132+
}
133+
114134
// Recursively show all node's children in a tree
115135
$.fn.expand = function() {
116136
if($(this).attr('ajax')!=undefined&&$(this).attr('proccessing')==undefined)
@@ -128,7 +148,6 @@
128148
initialize($(this));
129149
}
130150

131-
132151
if($(this).attr('proccessing')=='true')
133152
{
134153
// $(this).find('td:first').prepend('<img class="tableLoading" alt="" src="'+json.global.coreWebroot+'/public/images/icons/loading.gif"/>');
@@ -317,7 +336,7 @@
317336
var id=node.attr('id');
318337
elements['folders'] = jQuery.makeArray(elements['folders']);
319338
elements['items'] = jQuery.makeArray(elements['items']);
320-
var padding=parseInt(node.find('td:first').css('padding-left').slice(0,-2));
339+
// var padding=parseInt(node.find('td:first').css('padding-left').slice(0,-2));
321340
var html='';
322341
$.each(elements['folders'], function(index, value) {
323342
html+= "<tr id='"+id+"-"+i+"' deletable='"+value['deletable']+"' class='parent child-of-"+id+"' ajax='"+value['folder_id']+"'type='folder' policy='"+value['policy']+"' element='"+value['folder_id']+"'>";

0 commit comments

Comments
 (0)