hide irrelevant stuff in empty filelist

This commit is contained in:
Jörn Friedrich Dreyer 2014-12-19 00:49:05 +01:00
parent 74fd31d9bf
commit 80ded08ec4
1 changed files with 5 additions and 3 deletions

View File

@ -1669,7 +1669,7 @@
setFilter:function(filter) { setFilter:function(filter) {
this._filter = filter; this._filter = filter;
this.fileSummary.setFilter(filter, this.files); this.fileSummary.setFilter(filter, this.files);
this.hideHeaderWhenNoFilesMatch(); this.hideIrrelevantUIWhenNoFilesMatch();
var that = this; var that = this;
this.$fileList.find('tr').each(function(i,e) { this.$fileList.find('tr').each(function(i,e) {
var $e = $(e); var $e = $(e);
@ -1681,11 +1681,13 @@
} }
}); });
}, },
hideHeaderWhenNoFilesMatch:function() { hideIrrelevantUIWhenNoFilesMatch:function() {
if (this._filter && this.fileSummary.summary.totalDirs + this.fileSummary.summary.totalFiles === 0) { if (this._filter && this.fileSummary.summary.totalDirs + this.fileSummary.summary.totalFiles === 0) {
this.$el.find('#filestable thead th').addClass('hidden'); this.$el.find('#filestable thead th').addClass('hidden');
this.$el.find('#emptycontent').addClass('hidden');
} else { } else {
this.$el.find('#filestable thead th').removeClass('hidden'); this.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty);
this.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty);
} }
}, },
/** /**