Infinite scroll: keep loading more results until we overfill the screen

by at least 50%.

BUG=295

Change-Id: Ifdf3f05d4831cd7638d091a2e6e65a47b6b0e585
This commit is contained in:
Aaron Boodman 2013-12-28 23:35:09 -08:00
parent 6acca46b21
commit 9929e0ed50
1 changed files with 8 additions and 0 deletions

View File

@ -210,6 +210,14 @@ camlistore.BlobItemContainer.prototype.searchDone_ = function(query, searchMode,
result.blobs[result.blobs.length - 1].blob];
if (result.continue) {
this.scrollContinuation_ = this.search.bind(this, query, this.searchMode_.APPEND, result.continue);
// If the window was very large, we might not have enough data yet for the user to get their scroll on. Let's fix that.
this.layout_();
var docHeight = goog.dom.getDocumentHeight();
var viewportHeight = goog.dom.getViewportSize().height;
if (docHeight < (viewportHeight * 1.5)) {
this.scrollContinuation_();
}
}
};