]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make number of file list entries depending on the width for grid view 12515/head
authorJulius Härtl <jus@bitgrid.net>
Sun, 18 Nov 2018 09:34:35 +0000 (10:34 +0100)
committerJulius Härtl <jus@bitgrid.net>
Sun, 18 Nov 2018 09:44:53 +0000 (10:44 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/files/js/filelist.js

index 83510762c1af031b565fc10f7ffde030b1c4905b..94fdada937d7233c29417659ac6aced600062d0f 100644 (file)
                 * @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);
                },
 
                /**