summaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2016-08-29 20:36:07 +0200
committerGitHub <noreply@github.com>2016-08-29 20:36:07 +0200
commite1ea45f32bf2e06696b78c4e18ffbd5ffc3017cb (patch)
tree6688209730e0951a57a301ac23c3a005612bd16f /apps/files/js/filelist.js
parent606fd77432feb28b4a9a1ab52885560081c77540 (diff)
parent7fa66409ae0e0f07824af7f730003e686e0e2119 (diff)
downloadnextcloud-server-e1ea45f32bf2e06696b78c4e18ffbd5ffc3017cb.tar.gz
nextcloud-server-e1ea45f32bf2e06696b78c4e18ffbd5ffc3017cb.zip
Merge pull request #1147 from nextcloud/files-hidden-files-summary
Display number of hidden files in files summary (#25870)
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index e11f828b7c6..ca41012764a 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -199,6 +199,7 @@
* @param options.folderDropOptions folder drop options, disabled by default
* @param options.scrollTo name of file to scroll to after the first load
* @param {OC.Files.Client} [options.filesClient] files API client
+ * @param {OC.Backbone.Model} [options.filesConfig] files app configuration
* @private
*/
initialize: function($el, options) {
@@ -243,6 +244,7 @@
this._filesConfig.on('change:showhidden', function() {
var showHidden = this.get('showhidden');
self.$el.toggleClass('hide-hidden-files', !showHidden);
+ self.updateSelectionSummary();
if (!showHidden) {
// hiding files could make the page too small, need to try rendering next page
@@ -268,7 +270,7 @@
this.files = [];
this._selectedFiles = {};
- this._selectionSummary = new OCA.Files.FileSummary();
+ this._selectionSummary = new OCA.Files.FileSummary(undefined, {config: this._filesConfig});
// dummy root dir info
this.dirInfo = new OC.Files.FileInfo({});
@@ -2308,7 +2310,7 @@
var $tr = $('<tr class="summary"></tr>');
this.$el.find('tfoot').append($tr);
- return new OCA.Files.FileSummary($tr);
+ return new OCA.Files.FileSummary($tr, {config: this._filesConfig});
},
updateEmptyContent: function() {
var permissions = this.getDirectoryPermissions();
@@ -2455,6 +2457,7 @@
var summary = this._selectionSummary.summary;
var selection;
+ var showHidden = !!this._filesConfig.get('showhidden');
if (summary.totalFiles === 0 && summary.totalDirs === 0) {
this.$el.find('#headerName a.name>span:first').text(t('files','Name'));
this.$el.find('#headerSize a>span:first').text(t('files','Size'));
@@ -2481,6 +2484,11 @@
selection = fileInfo;
}
+ if (!showHidden && summary.totalHidden > 0) {
+ var hiddenInfo = n('files', 'including %n hidden', 'including %n hidden', summary.totalHidden);
+ selection += ' (' + hiddenInfo + ')';
+ }
+
this.$el.find('#headerName a.name>span:first').text(selection);
this.$el.find('#modified a>span:first').text('');
this.$el.find('table').addClass('multiselect');