diff options
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r-- | apps/files/js/filelist.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 980260928e8..c33a06bbdc3 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -7,11 +7,9 @@ var FileList={ }); }, update:function(fileListHtml) { - var $fileList = $('#fileList'), - permissions = $('#permissions').val(), - isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; + var $fileList = $('#fileList'); $fileList.empty().html(fileListHtml); - $('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').exists()); + FileList.updateEmptyContent(); $fileList.find('tr').each(function () { FileActions.display($(this).children('td.filename')); }); @@ -252,7 +250,6 @@ var FileList={ $('.creatable').toggleClass('hidden', !isCreatable); $('.notCreatable').toggleClass('hidden', isCreatable); }, - /** * Shows/hides action buttons * @@ -284,6 +281,7 @@ var FileList={ FileList.updateFileSummary(); if ( ! $('tr[data-file]').exists() ) { $('#emptycontent').removeClass('hidden'); + $('#filescontent th').addClass('hidden'); } }, insertElement:function(name, type, element) { @@ -316,6 +314,7 @@ var FileList={ $('#fileList').append(element); } $('#emptycontent').addClass('hidden'); + $('#filestable th').removeClass('hidden'); FileList.updateFileSummary(); }, loadingDone:function(name, id) { @@ -551,6 +550,7 @@ var FileList={ procesSelection(); checkTrashStatus(); FileList.updateFileSummary(); + FileList.updateEmptyContent(); } else { $.each(files,function(index,file) { var deleteAction = $('tr[data-file="'+files[i]+'"]').children("td.date").children(".action.delete"); @@ -664,6 +664,13 @@ var FileList={ } } }, + updateEmptyContent: function() { + var $fileList = $('#fileList'); + var permissions = $('#permissions').val(); + var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; + $('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').exists()); + $('#filestable th').toggleClass('hidden', $fileList.find('tr').exists() === false); + }, showMask: function() { // in case one was shown before var $mask = $('#content .mask'); |