| 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 resultLoadingDisabled_: { | 22 resultLoadingDisabled_: { |
| 23 type: Boolean, | 23 type: Boolean, |
| 24 value: false, | 24 value: false, |
| 25 }, | 25 }, |
| 26 | 26 |
| 27 lastFocused_: Object, | 27 lastFocused_: Object, |
| 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() { | |
| 158 this.fire('history-list-scrolled'); | |
| 159 }, | |
| 160 | |
| 161 /** | |
| 162 * @param {number} index | 154 * @param {number} index |
| 163 * @return {string} | 155 * @return {string} |
| 164 * @private | 156 * @private |
| 165 */ | 157 */ |
| 166 pathForItem_: function(index) { | 158 pathForItem_: function(index) { |
| 167 return 'historyData_.' + index; | 159 return 'historyData_.' + index; |
| 168 }, | 160 }, |
| 169 }); | 161 }); |
| OLD | NEW |