summaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-10-16 11:21:49 +0200
committerVincent Petry <pvince81@owncloud.com>2014-10-16 11:21:49 +0200
commit08582d145c628b4651fc83a62cdf890e4b40be4f (patch)
treea7c0bb0d9b2d8e1cac2a1cd88754ad7150870793 /apps/files/js/filelist.js
parent0254a3c406f2a945e2b01bbde3044d5a60751750 (diff)
parent8198e70f24e2645904471c19f514a4e0408f4d74 (diff)
downloadnextcloud-server-08582d145c628b4651fc83a62cdf890e4b40be4f.tar.gz
nextcloud-server-08582d145c628b4651fc83a62cdf890e4b40be4f.zip
Merge pull request #11524 from nazar-pc/patch-1
Page size calculation based on real page height
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index c70c866c634..cf1d9780d99 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -49,8 +49,10 @@
fileSummary: null,
initialized: false,
- // number of files per page
- pageSize: 20,
+ // number of files per page, calculated dynamically
+ pageSize: function() {
+ return Math.ceil(this.$container.height() / 50);
+ },
/**
* Array of files in the current folder.
@@ -496,7 +498,7 @@
*/
_nextPage: function(animate) {
var index = this.$fileList.children().length,
- count = this.pageSize,
+ count = this.pageSize(),
tr,
fileData,
newTrs = [],
@@ -1189,7 +1191,7 @@
// if there are less elements visible than one page
// but there are still pending elements in the array,
// then directly append the next page
- if (lastIndex < this.files.length && lastIndex < this.pageSize) {
+ if (lastIndex < this.files.length && lastIndex < this.pageSize()) {
this._nextPage(true);
}