|
53 | 53 | // Recursively hide all node's children in a tree
|
54 | 54 | $.fn.collapse = function() {
|
55 | 55 | $(this).addClass("collapsed");
|
56 |
| - |
57 | 56 | childrenOf($(this)).each(function() {
|
58 | 57 | if(!$(this).hasClass("collapsed")) {
|
59 | 58 | $(this).collapse();
|
|
93 | 92 | {
|
94 | 93 | $.post(json.global.webroot+'/browse/getfolderscontent',{folders: folders} , function(data) {
|
95 | 94 | arrayElement=jQuery.parseJSON(data);
|
96 |
| - $.each(arrayElement, function(index, value) { |
| 95 | + $.each(arrayElement, function(index, value) { |
97 | 96 | tree[index]=value;
|
98 | 97 | });
|
99 | 98 | children.each(function()
|
|
111 | 110 | getElementsSize();
|
112 | 111 | }
|
113 | 112 |
|
| 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 | + |
114 | 134 | // Recursively show all node's children in a tree
|
115 | 135 | $.fn.expand = function() {
|
116 | 136 | if($(this).attr('ajax')!=undefined&&$(this).attr('proccessing')==undefined)
|
|
128 | 148 | initialize($(this));
|
129 | 149 | }
|
130 | 150 |
|
131 |
| - |
132 | 151 | if($(this).attr('proccessing')=='true')
|
133 | 152 | {
|
134 | 153 | // $(this).find('td:first').prepend('<img class="tableLoading" alt="" src="'+json.global.coreWebroot+'/public/images/icons/loading.gif"/>');
|
|
317 | 336 | var id=node.attr('id');
|
318 | 337 | elements['folders'] = jQuery.makeArray(elements['folders']);
|
319 | 338 | 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)); |
321 | 340 | var html='';
|
322 | 341 | $.each(elements['folders'], function(index, value) {
|
323 | 342 | 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