diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-11-07 22:06:05 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-11-07 22:06:05 +0100 |
commit | 42935c55647a2531d7de30f4f1181f15b9e15386 (patch) | |
tree | 37b048bfc1b49ca6549d5d29f1b46c06ddc04042 /apps | |
parent | e14054610f3dcb672370158da87f4db3c0e43552 (diff) | |
download | nextcloud-server-42935c55647a2531d7de30f4f1181f15b9e15386.tar.gz nextcloud-server-42935c55647a2531d7de30f4f1181f15b9e15386.zip |
reuse jquery object when adding files to the file list
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/filelist.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index f08e412921e..428026a7659 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -32,13 +32,14 @@ var FileList={ html+='<td class="date"><span class="modified" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</span></td>'; html+='</tr>'; FileList.insertElement(name,'file',$(html).attr('data-file',name)); + var row = $('tr').filterAttr('data-file',name); if(loading){ - $('tr').filterAttr('data-file',name).data('loading',true); + row.data('loading',true); }else{ - $('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions); + row.find('td.filename').draggable(dragOptions); } if (hidden) { - $('tr').filterAttr('data-file', name).hide(); + row.hide(); } }, addDir:function(name,size,lastModified,hidden){ @@ -66,10 +67,11 @@ var FileList={ td.append($('<span></span>').attr({ "class": "modified", "title": formatDate(lastModified), "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' }).text( relative_modified_date(lastModified.getTime() / 1000) )); html.append(td); FileList.insertElement(name,'dir',html); - $('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions); - $('tr').filterAttr('data-file',name).find('td.filename').droppable(folderDropOptions); + var row = $('tr').filterAttr('data-file',name); + row.find('td.filename').draggable(dragOptions); + row.find('td.filename').droppable(folderDropOptions); if (hidden) { - $('tr').filterAttr('data-file', name).hide(); + row.hide(); } }, refresh:function(data) { |