From 1141fcc9ac1dfd80deeef66e82ee2c8968bdce4d Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 7 Nov 2016 13:04:39 +0100 Subject: Skip hidden files when counting visible files in list (#26522) The file list UI logic that renders the next page doesn't properly exclude hidden files when not shown. This fix makes sure that only rows that are actually visible are counted when rendering a page, this makes sure that the page will always have enough elements displayed. --- apps/files/js/filelist.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'apps/files/js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index c53fa4f3d66..d32c3ba7c9e 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -923,7 +923,8 @@ tr, fileData, newTrs = [], - isAllSelected = this.isAllSelected(); + isAllSelected = this.isAllSelected(), + showHidden = this._filesConfig.get('showhidden'); if (index >= this.files.length) { return false; @@ -947,7 +948,10 @@ } newTrs.push(tr); index++; - count--; + // only count visible rows + if (showHidden || !tr.hasClass('hidden-file')) { + count--; + } } // trigger event for newly added rows -- cgit v1.2.3