aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-11-18 10:34:35 +0100
committerJulius Härtl <jus@bitgrid.net>2018-11-18 10:44:53 +0100
commiteb039608f99d24eb30a6ecae3cfe60f337572776 (patch)
tree43e9d7a2f99de9d05355bd1152b5474f2996da02 /apps/files
parent8bf7ec26e0b064f55224a202f2137b19eb2432d6 (diff)
downloadnextcloud-server-eb039608f99d24eb30a6ecae3cfe60f337572776.tar.gz
nextcloud-server-eb039608f99d24eb30a6ecae3cfe60f337572776.zip
Make number of file list entries depending on the width for grid view
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files')
-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);
},
/**