Chromium Code Reviews| 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. |