Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3999)

Unified Diff: chrome/browser/resources/md_history/history_list.js

Issue 1941133002: MD History: Use iron-scroll-threshold to determine when to load new data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pseudomaster
Patch Set: Fix closure compile (how exciting!) Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_history/history_list.js
diff --git a/chrome/browser/resources/md_history/history_list.js b/chrome/browser/resources/md_history/history_list.js
index c5216edb9fd3b55f2f9559109eeb13aa961a1f26..1c537777dd202a39f0ef0ad450798049c51bcf08 100644
--- a/chrome/browser/resources/md_history/history_list.js
+++ b/chrome/browser/resources/md_history/history_list.js
@@ -89,6 +89,8 @@ Polymer({
*/
addNewResults: function(historyResults, searchTerm) {
this.loading_ = false;
+ /** @type {IronScrollThresholdElement} */(this.$['scroll-threshold'])
+ .clearTriggers();
if (this.searchTerm != searchTerm) {
this.resultLoadingDisabled_ = false;
@@ -207,24 +209,16 @@ Polymer({
},
/**
- * Called when the card manager is scrolled.
+ * Called when the page is scrolled to near the bottom of the list.
* @private
*/
- scrollHandler_: function() {
- if (this.resultLoadingDisabled_)
+ loadMoreData_: function() {
+ if (this.resultLoadingDisabled_ || this.loading_)
return;
- // Requests the next list of results when the scrollbar is near the bottom
- // of the window.
- var scrollOffset = 10;
- var scrollElem = this.$['infinite-list'];
-
- if (!this.loading_ && scrollElem.scrollHeight <=
- scrollElem.scrollTop + scrollElem.clientHeight + scrollOffset) {
- this.loading_ = true;
- chrome.send('queryHistory',
- [this.searchTerm, 0, 0, this.lastVisitedTime, RESULTS_PER_PAGE]);
- }
+ this.loading_ = true;
+ chrome.send('queryHistory',
+ [this.searchTerm, 0, 0, this.lastVisitedTime, RESULTS_PER_PAGE]);
},
/**
« no previous file with comments | « chrome/browser/resources/md_history/history_list.html ('k') | third_party/polymer/v1_0/find_unused_elements.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698