From: kondou Date: Sat, 12 Oct 2013 15:28:20 +0000 (+0200) Subject: Hide files list header, when theres no files to see X-Git-Tag: v6.0.0beta2~51^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f828b51ede75ef25db3859156691fb582b76fe39;p=nextcloud-server.git Hide files list header, when theres no files to see --- diff --git a/apps/files/index.php b/apps/files/index.php index 8d877be8ac9..7db3fd96380 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -118,6 +118,9 @@ if ($needUpgrade) { $trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user); } + $isCreatable = \OC\Files\Filesystem::isCreatable($dir . '/'); + $emptyContent = (!isset($files) or !$isCreatable or count($files) > 0 or $ajaxLoad); + OCP\Util::addscript('files', 'fileactions'); OCP\Util::addscript('files', 'files'); OCP\Util::addscript('files', 'keyboardshortcuts'); @@ -125,7 +128,7 @@ if ($needUpgrade) { $tmpl->assign('fileList', $list->fetchPage()); $tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage()); $tmpl->assign('dir', \OC\Files\Filesystem::normalizePath($dir)); - $tmpl->assign('isCreatable', \OC\Files\Filesystem::isCreatable($dir . '/')); + $tmpl->assign('isCreatable', $isCreatable); $tmpl->assign('permissions', $permissions); $tmpl->assign('files', $files); $tmpl->assign('trash', $trashEnabled); @@ -141,6 +144,7 @@ if ($needUpgrade) { $tmpl->assign("encryptionInitStatus", $encryptionInitStatus); $tmpl->assign('disableSharing', false); $tmpl->assign('ajaxLoad', $ajaxLoad); + $tmpl->assign('emptyContent', $emptyContent); $tmpl->printPage(); } diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index a9297996778..7a0cfa83255 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -12,6 +12,7 @@ var FileList={ isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0; $fileList.empty().html(fileListHtml); $('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').length > 0); + $('#filestable th').toggleClass('hidden', !(!isCreatable || $fileList.find('tr').length > 0)); $fileList.find('tr').each(function () { FileActions.display($(this).children('td.filename')); }); @@ -257,6 +258,7 @@ var FileList={ FileList.updateFileSummary(); if($('tr[data-file]').length==0){ $('#emptycontent').removeClass('hidden'); + $('#filescontent th').addClass('hidden'); } }, insertElement:function(name,type,element){ @@ -287,6 +289,7 @@ var FileList={ $('#fileList').append(element); } $('#emptycontent').addClass('hidden'); + $('#filestable th').removeClass('hidden'); FileList.updateFileSummary(); }, loadingDone:function(name, id){ diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 32a59f1e1a6..af9cdffa5a3 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -42,14 +42,14 @@ -
0 or $_['ajaxLoad']):?>class="hidden">t('Nothing in here. Upload something!'))?>
+
class="hidden">t('Nothing in here. Upload something!'))?>
- - - +
+ class="hidden" id='headerName'>
@@ -65,8 +65,8 @@
t('Size')); ?> + class="hidden" id="headerSize">t('Size')); ?>class="hidden" id="headerDate"> t( 'Modified' )); ?>