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

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

Issue 2965463002: MD History: Reset scroll position when displaying new results (Closed)
Patch Set: Created 3 years, 5 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 | no next file » | 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 addNewResults: function(historyResults, incremental, finished) { 105 addNewResults: function(historyResults, incremental, finished) {
106 var results = historyResults.slice(); 106 var results = historyResults.slice();
107 /** @type {IronScrollThresholdElement} */ (this.$['scroll-threshold']) 107 /** @type {IronScrollThresholdElement} */ (this.$['scroll-threshold'])
108 .clearTriggers(); 108 .clearTriggers();
109 109
110 if (!incremental) { 110 if (!incremental) {
111 this.resultLoadingDisabled_ = false; 111 this.resultLoadingDisabled_ = false;
112 if (this.historyData_) 112 if (this.historyData_)
113 this.splice('historyData_', 0, this.historyData_.length); 113 this.splice('historyData_', 0, this.historyData_.length);
114 this.fire('unselect-all'); 114 this.fire('unselect-all');
115 this.scrollTop = 0;
115 } 116 }
116 117
117 if (this.historyData_) { 118 if (this.historyData_) {
118 // If we have previously received data, push the new items onto the 119 // If we have previously received data, push the new items onto the
119 // existing array. 120 // existing array.
120 results.unshift('historyData_'); 121 results.unshift('historyData_');
121 this.push.apply(this, results); 122 this.push.apply(this, results);
122 } else { 123 } else {
123 // The first time we receive data, use set() to ensure the iron-list is 124 // The first time we receive data, use set() to ensure the iron-list is
124 // initialized correctly. 125 // initialized correctly.
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 results[i].selected = false; 485 results[i].selected = false;
485 results[i].readableTimestamp = 486 results[i].readableTimestamp =
486 info.term == '' ? results[i].dateTimeOfDay : results[i].dateShort; 487 info.term == '' ? results[i].dateTimeOfDay : results[i].dateShort;
487 488
488 if (results[i].dateRelativeDay != currentDate) { 489 if (results[i].dateRelativeDay != currentDate) {
489 currentDate = results[i].dateRelativeDay; 490 currentDate = results[i].dateRelativeDay;
490 } 491 }
491 } 492 }
492 }, 493 },
493 }); 494 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698