summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-30 17:20:25 +0200
committerGitHub <noreply@github.com>2016-06-30 17:20:25 +0200
commit22746990e6154616b6775fde5ab97c87d6603ed4 (patch)
treedc592bb53870475afc74fb1d7dc9662adaeb8ab0
parent1b9fa4dd5f615def8dd95ad0b27550eadb868f70 (diff)
parent5cfbb9624fe556ed5aa9d1b247fcf9be40be49db (diff)
downloadnextcloud-server-22746990e6154616b6775fde5ab97c87d6603ed4.tar.gz
nextcloud-server-22746990e6154616b6775fde5ab97c87d6603ed4.zip
Merge pull request #25310 from owncloud/search-preventinfiniteloop
Prevent infinite loop in search auto-nextpage
-rw-r--r--apps/files/js/filelist.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 18f17a7207c..690e5e70fdb 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -2352,13 +2352,16 @@
*/
setFilter:function(filter) {
var total = 0;
+ if (this._filter === filter) {
+ return;
+ }
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();
@@ -2378,7 +2381,7 @@
if (visibleCount < total) {
$trs = this._nextPage(false);
}
- } while (visibleCount < total);
+ } while (visibleCount < total && $trs.length > 0);
this.$container.trigger('scroll');
},