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

Side by Side Diff: chrome/browser/resources/md_history/history_list.js

Issue 2053553002: MD History: Deselect items when clicking 'More from this site' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deselect when results come in Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/md_history/history_list_test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 Polymer({ 5 Polymer({
6 is: 'history-list', 6 is: 'history-list',
7 7
8 properties: { 8 properties: {
9 // The search term for the current query. Set when the query returns. 9 // The search term for the current query. Set when the query returns.
10 searchedTerm: { 10 searchedTerm: {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 */ 87 */
88 addNewResults: function(historyResults) { 88 addNewResults: function(historyResults) {
89 var results = historyResults.slice(); 89 var results = historyResults.slice();
90 /** @type {IronScrollThresholdElement} */(this.$['scroll-threshold']) 90 /** @type {IronScrollThresholdElement} */(this.$['scroll-threshold'])
91 .clearTriggers(); 91 .clearTriggers();
92 92
93 if (this.lastSearchedTerm_ != this.searchedTerm) { 93 if (this.lastSearchedTerm_ != this.searchedTerm) {
94 this.resultLoadingDisabled_ = false; 94 this.resultLoadingDisabled_ = false;
95 if (this.historyData_) 95 if (this.historyData_)
96 this.splice('historyData_', 0, this.historyData_.length); 96 this.splice('historyData_', 0, this.historyData_.length);
97 this.fire('unselect-all');
97 this.lastSearchedTerm_ = this.searchedTerm; 98 this.lastSearchedTerm_ = this.searchedTerm;
98 } 99 }
99 100
100 if (this.historyData_) { 101 if (this.historyData_) {
101 // If we have previously received data, push the new items onto the 102 // If we have previously received data, push the new items onto the
102 // existing array. 103 // existing array.
103 results.unshift('historyData_'); 104 results.unshift('historyData_');
104 this.push.apply(this, results); 105 this.push.apply(this, results);
105 } else { 106 } else {
106 // The first time we receive data, use set() to ensure the iron-list is 107 // The first time we receive data, use set() to ensure the iron-list is
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 * @private 238 * @private
238 */ 239 */
239 isCardEnd_: function(item, i, length) { 240 isCardEnd_: function(item, i, length) {
240 if (length == 0 || i > length - 1) 241 if (length == 0 || i > length - 1)
241 return false; 242 return false;
242 return i == length - 1 || 243 return i == length - 1 ||
243 this.historyData_[i].dateRelativeDay != 244 this.historyData_[i].dateRelativeDay !=
244 this.historyData_[i + 1].dateRelativeDay; 245 this.historyData_[i + 1].dateRelativeDay;
245 }, 246 },
246 }); 247 });
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webui/md_history/history_list_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698