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

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

Issue 2200233003: MD History: Refresh the list when clearing browsing data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: consider search term Created 4 years, 4 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 aaba6536622c5929aba6360e9ff38e4a8f659dfc..9da58e4b1a52f8ec55c9b1d6b32ede550e4c0ab1 100644
--- a/chrome/browser/resources/md_history/history_list.js
+++ b/chrome/browser/resources/md_history/history_list.js
@@ -81,10 +81,15 @@ Polymer({
}
if (this.historyData_) {
- // If we have previously received data, push the new items onto the
- // existing array.
- results.unshift('historyData_');
- this.push.apply(this, results);
lshang 2016/08/04 00:17:04 These two lines seem not right. When there are ne
tsergeant 2016/08/04 01:25:55 These lines support infinite scrolling. When we do
lshang 2016/08/05 03:39:03 Ah, it's for infinite scrolling! Then it makes sen
+ // If we have previously received data, refresh the list unless the user
+ // has any items checked.
+ var selectedItem = this.historyData_.filter(function(item) {
+ return item.selected;
+ });
+ if (selectedItem.length == 0) {
+ this.splice('historyData_', 0, this.historyData_.length);
+ this.set('historyData_', results);
+ }
} else {
// The first time we receive data, use set() to ensure the iron-list is
// initialized correctly.

Powered by Google App Engine
This is Rietveld 408576698