From 7427fb170f853cde26289890aabc98d74f8707be Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 21 Oct 2016 16:35:55 +0200 Subject: [PATCH] show empty folder message in filepicker Signed-off-by: Robin Appelman --- core/css/styles.css | 8 ++++++++ core/js/oc-dialogs.js | 9 ++++++++- core/templates/filepicker.html | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/core/css/styles.css b/core/css/styles.css index 94e60562ad8..d94a31c4cf1 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -782,6 +782,14 @@ a.bookmarklet { background-color:#ddd; border:1px solid #ccc; padding:5px;paddin width: 100%; padding-bottom: 55px; } + +#oc-dialog-filepicker-content .emptycontent { + color: #888; + text-align: center; + margin-top: 80px; + width: 100%; + display: none; +} #oc-dialog-filepicker-content .filelist { background-color:white; width:100%; diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index 7a7876bf30f..5cf45fe0fb9 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -157,7 +157,8 @@ var OCdialogs = { } self.$filePicker = $tmpl.octemplate({ dialog_name: dialogName, - title: title + title: title, + emptytext: t('core', 'No files in here') }).data('path', '').data('multiselect', multiselect).data('mimetype', mimetypeFilter); if (modal === undefined) { @@ -771,6 +772,12 @@ var OCdialogs = { self._fillSlug(); + if (files.length === 0) { + self.$filePicker.find('.emptycontent').show(); + } else { + self.$filePicker.find('.emptycontent').hide(); + } + $.each(files, function(idx, entry) { entry.icon = OC.MimeType.getIconUrl(entry.mimetype); if (typeof(entry.size) !== 'undefined' && entry.size >= 0) { diff --git a/core/templates/filepicker.html b/core/templates/filepicker.html index b665ca26893..215311348cb 100644 --- a/core/templates/filepicker.html +++ b/core/templates/filepicker.html @@ -1,6 +1,10 @@
+
+
+

{emptytext}

+
-- 2.39.5