| 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 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: { |
| 11 type: String, | 11 type: String, |
| 12 value: '', | 12 value: '', |
| 13 }, | 13 }, |
| 14 | 14 |
| 15 lastSearchedTerm_: String, | 15 lastSearchedTerm_: String, |
| 16 | 16 |
| 17 querying: Boolean, | 17 querying: Boolean, |
| 18 | 18 |
| 19 // An array of history entries in reverse chronological order. | 19 // An array of history entries in reverse chronological order. |
| 20 historyData_: Array, | 20 historyData_: Array, |
| 21 | 21 |
| 22 resultLoadingDisabled_: { | 22 resultLoadingDisabled_: { |
| 23 type: Boolean, | 23 type: Boolean, |
| 24 value: false, | 24 value: false, |
| 25 }, | 25 }, |
| 26 }, | 26 }, |
| 27 | 27 |
| 28 listeners: { | 28 listeners: { |
| 29 'infinite-list.scroll': 'notifyListScroll_', | 29 'scroll': 'notifyListScroll_', |
| 30 'remove-bookmark-stars': 'removeBookmarkStars_', | 30 'remove-bookmark-stars': 'removeBookmarkStars_', |
| 31 }, | 31 }, |
| 32 | 32 |
| 33 /** @override */ | 33 /** @override */ |
| 34 attached: function() { | 34 attached: function() { |
| 35 // It is possible (eg, when middle clicking the reload button) for all other | 35 // It is possible (eg, when middle clicking the reload button) for all other |
| 36 // resize events to fire before the list is attached and can be measured. | 36 // resize events to fire before the list is attached and can be measured. |
| 37 // Adding another resize here ensures it will get sized correctly. | 37 // Adding another resize here ensures it will get sized correctly. |
| 38 /** @type {IronListElement} */(this.$['infinite-list']).notifyResize(); | 38 /** @type {IronListElement} */(this.$['infinite-list']).notifyResize(); |
| 39 this.$['infinite-list'].scrollTarget = this; |
| 40 this.$['scroll-threshold'].scrollTarget = this; |
| 39 }, | 41 }, |
| 40 | 42 |
| 41 /** | 43 /** |
| 42 * Remove bookmark star for history items with matching URLs. | 44 * Remove bookmark star for history items with matching URLs. |
| 43 * @param {{detail: !string}} e | 45 * @param {{detail: !string}} e |
| 44 * @private | 46 * @private |
| 45 */ | 47 */ |
| 46 removeBookmarkStars_: function(e) { | 48 removeBookmarkStars_: function(e) { |
| 47 var url = e.detail; | 49 var url = e.detail; |
| 48 | 50 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 return index == 0; | 240 return index == 0; |
| 239 }, | 241 }, |
| 240 | 242 |
| 241 /** | 243 /** |
| 242 * @private | 244 * @private |
| 243 */ | 245 */ |
| 244 notifyListScroll_: function() { | 246 notifyListScroll_: function() { |
| 245 this.fire('history-list-scrolled'); | 247 this.fire('history-list-scrolled'); |
| 246 }, | 248 }, |
| 247 }); | 249 }); |
| OLD | NEW |