mirror of https://github.com/perkeep/perkeep.git
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:
parent
6acca46b21
commit
9929e0ed50
|
@ -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_();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue