diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-10-30 16:14:08 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-10-30 16:14:08 +0100 |
commit | aeac3186ee52fcadf57b34fc307f5441041cb43d (patch) | |
tree | 5784e249da5753e7004d190286b0034684cfa537 | |
parent | 4c7ef852524ef41c23446e540e7e531fb1eca8b0 (diff) | |
download | nextcloud-server-aeac3186ee52fcadf57b34fc307f5441041cb43d.tar.gz nextcloud-server-aeac3186ee52fcadf57b34fc307f5441041cb43d.zip |
Fixed summary visibility check
Now using the integer values to check whether to show the summary parts
instead of trying to parse the html code.
-rw-r--r-- | apps/files/js/filelist.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index c33a06bbdc3..02dfa16a224 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -593,18 +593,19 @@ var FileList={ var fileSize = '<td class="filesize">'+humanFileSize(totalSize)+'</td>'; } - $('#fileList').append('<tr class="summary"><td><span class="info">'+info+'</span></td>'+fileSize+'<td></td></tr>'); + var $summary = $('<tr class="summary"><td><span class="info">'+info+'</span></td>'+fileSize+'<td></td></tr>'); + $('#fileList').append($summary); - var $dirInfo = $('.summary .dirinfo'); - var $fileInfo = $('.summary .fileinfo'); - var $connector = $('.summary .connector'); + var $dirInfo = $summary.find('.dirinfo'); + var $fileInfo = $summary.find('.fileinfo'); + var $connector = $summary.find('.connector'); // Show only what's necessary, e.g.: no files: don't show "0 files" - if ($dirInfo.html().charAt(0) === "0") { + if (totalDirs === 0) { $dirInfo.hide(); $connector.hide(); } - if ($fileInfo.html().charAt(0) === "0") { + if (totalFiles === 0) { $fileInfo.hide(); $connector.hide(); } |