| OLD | NEW |
| 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 behaviors: [HistoryListBehavior], | 8 behaviors: [HistoryListBehavior], |
| 9 | 9 |
| 10 properties: { | 10 properties: { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // An array of history entries in reverse chronological order. | 22 // An array of history entries in reverse chronological order. |
| 23 historyData_: Array, | 23 historyData_: Array, |
| 24 | 24 |
| 25 lastFocused_: Object, | 25 lastFocused_: Object, |
| 26 | 26 |
| 27 querying: Boolean, | 27 querying: Boolean, |
| 28 }, | 28 }, |
| 29 | 29 |
| 30 listeners: { | 30 listeners: { |
| 31 'scroll': 'notifyListScroll_', | |
| 32 'remove-bookmark-stars': 'removeBookmarkStars_', | 31 'remove-bookmark-stars': 'removeBookmarkStars_', |
| 33 }, | 32 }, |
| 34 | 33 |
| 35 /** @override */ | 34 /** @override */ |
| 36 attached: function() { | 35 attached: function() { |
| 37 // It is possible (eg, when middle clicking the reload button) for all other | 36 // It is possible (eg, when middle clicking the reload button) for all other |
| 38 // resize events to fire before the list is attached and can be measured. | 37 // resize events to fire before the list is attached and can be measured. |
| 39 // Adding another resize here ensures it will get sized correctly. | 38 // Adding another resize here ensures it will get sized correctly. |
| 40 /** @type {IronListElement} */ (this.$['infinite-list']).notifyResize(); | 39 /** @type {IronListElement} */ (this.$['infinite-list']).notifyResize(); |
| 41 this.$['infinite-list'].scrollTarget = this; | 40 this.$['infinite-list'].scrollTarget = this; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 */ | 144 */ |
| 146 isCardEnd_: function(item, i, length) { | 145 isCardEnd_: function(item, i, length) { |
| 147 if (length == 0 || i > length - 1) | 146 if (length == 0 || i > length - 1) |
| 148 return false; | 147 return false; |
| 149 return i == length - 1 || | 148 return i == length - 1 || |
| 150 this.historyData_[i].dateRelativeDay != | 149 this.historyData_[i].dateRelativeDay != |
| 151 this.historyData_[i + 1].dateRelativeDay; | 150 this.historyData_[i + 1].dateRelativeDay; |
| 152 }, | 151 }, |
| 153 | 152 |
| 154 /** | 153 /** |
| 155 * @private | |
| 156 */ | |
| 157 notifyListScroll_: function() { this.fire('history-list-scrolled'); }, | |
| 158 | |
| 159 /** | |
| 160 * @param {number} index | 154 * @param {number} index |
| 161 * @return {string} | 155 * @return {string} |
| 162 * @private | 156 * @private |
| 163 */ | 157 */ |
| 164 pathForItem_: function(index) { return 'historyData_.' + index; }, | 158 pathForItem_: function(index) { return 'historyData_.' + index; }, |
| 165 }); | 159 }); |
| OLD | NEW |