aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-27 13:46:25 +0200
committerGitHub <noreply@github.com>2016-06-27 13:46:25 +0200
commit1d4c61af47d3b52a26080cb9046dd412cf3109f7 (patch)
treebce474e99fab5396561281b4675b19071d0edee9 /apps/files/js
parent579bc57d16797c4e74794d0b53e2a56af82df962 (diff)
parentb4cf29775849236be338fc7c8e2ad0d7f361ade7 (diff)
downloadnextcloud-server-1d4c61af47d3b52a26080cb9046dd412cf3109f7.tar.gz
nextcloud-server-1d4c61af47d3b52a26080cb9046dd412cf3109f7.zip
Merge pull request #25237 from owncloud/search-filelistnextpageresults
Prerender file list pages to include search results
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index f249f2d35c9..18f17a7207c 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -2351,22 +2351,36 @@
* @param filter
*/
setFilter:function(filter) {
+ var total = 0;
this._filter = filter;
this.fileSummary.setFilter(filter, this.files);
+ total = this.fileSummary.getTotal();
if (!this.$el.find('.mask').exists()) {
this.hideIrrelevantUIWhenNoFilesMatch();
}
var that = this;
+ var visibleCount = 0;
filter = filter.toLowerCase();
- this.$fileList.find('tr').each(function(i,e) {
- var $e = $(e);
+
+ function filterRows(tr) {
+ var $e = $(tr);
if ($e.data('file').toString().toLowerCase().indexOf(filter) === -1) {
$e.addClass('hidden');
} else {
+ visibleCount++;
$e.removeClass('hidden');
}
- });
- that.$container.trigger('scroll');
+ }
+
+ var $trs = this.$fileList.find('tr');
+ do {
+ _.each($trs, filterRows);
+ if (visibleCount < total) {
+ $trs = this._nextPage(false);
+ }
+ } while (visibleCount < total);
+
+ this.$container.trigger('scroll');
},
hideIrrelevantUIWhenNoFilesMatch:function() {
if (this._filter && this.fileSummary.summary.totalDirs + this.fileSummary.summary.totalFiles === 0) {