summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-11-19 10:52:54 +0100
committerGitHub <noreply@github.com>2018-11-19 10:52:54 +0100
commitea46c111a0b0352fc5e7ec67de25f64bcc30def0 (patch)
tree3be3789a3a0010eb03b562bee51ffacb1764ac6f /apps
parenta9e7b65de85c33f121be1736acb59272c020d5b2 (diff)
parenteb039608f99d24eb30a6ecae3cfe60f337572776 (diff)
downloadnextcloud-server-ea46c111a0b0352fc5e7ec67de25f64bcc30def0.tar.gz
nextcloud-server-ea46c111a0b0352fc5e7ec67de25f64bcc30def0.zip
Merge pull request #12515 from nextcloud/papercut/12295/grid-view-lazy-loading
Make number of file list entries depending on the width for grid view
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 83510762c1a..94fdada937d 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -99,7 +99,14 @@
* @return {int} page size
*/
pageSize: function() {
- return Math.max(Math.ceil(this.$container.height() / 50), 1);
+ var isGridView = this.$showGridView.is(':checked');
+ var columns = 1;
+ var rows = Math.ceil(this.$container.height() / 50);
+ if (isGridView) {
+ columns = Math.ceil(this.$container.width() / 160);
+ rows = Math.ceil(this.$container.height() / 160);
+ }
+ return Math.max(columns*rows, columns);
},
/**