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

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

Issue 2481693002: [MD History] Make forward/backward work in grouped mode. (Closed)
Patch Set: rebase Created 4 years 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/list_container.js
diff --git a/chrome/browser/resources/md_history/list_container.js b/chrome/browser/resources/md_history/list_container.js
index 613fa147a8123eef8e34f5de34602e0b83a2d126..48929cfe5aad7c67913b06234cf3cd3534c36300 100644
--- a/chrome/browser/resources/md_history/list_container.js
+++ b/chrome/browser/resources/md_history/list_container.js
@@ -24,6 +24,7 @@ Polymer({
observers: [
'searchTermChanged_(queryState.searchTerm)',
+ 'groupedOffsetChanged_(queryState.groupedOffset)',
],
listeners: {
@@ -35,7 +36,7 @@ Polymer({
/**
* @param {HistoryQuery} info An object containing information about the
* query.
- * @param {!Array<HistoryEntry>} results A list of results.
+ * @param {!Array<!HistoryEntry>} results A list of results.
*/
historyResult: function(info, results) {
this.initializeResults_(info, results);
@@ -152,6 +153,15 @@ Polymer({
if (oldRange == undefined)
return;
+ this.set('queryState.groupedOffset', 0);
+
+ // Reset the results on range change to prevent stale results from being
+ // processed into the incoming range's UI.
+ if (this.queryResult.info) {
+ this.set('queryResult.results', []);
+ this.historyResult(this.queryResult.info, []);
+ }
+
this.queryHistory(false);
this.fire('history-view-changed');
},
@@ -165,6 +175,11 @@ Polymer({
},
/** @private */
+ groupedOffsetChanged_: function() {
+ this.queryHistory(false);
+ },
+
+ /** @private */
loadMoreHistory_: function() { this.queryHistory(true); },
/**

Powered by Google App Engine
This is Rietveld 408576698