| 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: { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 }, | 25 }, |
| 26 }, | 26 }, |
| 27 | 27 |
| 28 listeners: { | 28 listeners: { |
| 29 'infinite-list.scroll': 'closeMenu_', | 29 'infinite-list.scroll': 'closeMenu_', |
| 30 'tap': 'closeMenu_', | 30 'tap': 'closeMenu_', |
| 31 'toggle-menu': 'toggleMenu_', | 31 'toggle-menu': 'toggleMenu_', |
| 32 'remove-bookmark-stars': 'removeBookmarkStars_', | 32 'remove-bookmark-stars': 'removeBookmarkStars_', |
| 33 }, | 33 }, |
| 34 | 34 |
| 35 /** @override */ |
| 36 attached: function() { |
| 37 // 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. |
| 39 // Adding another resize here ensures it will get sized correctly. |
| 40 /** @type {IronListElement} */(this.$['infinite-list']).notifyResize(); |
| 41 }, |
| 42 |
| 35 /** | 43 /** |
| 36 * Closes the overflow menu. | 44 * Closes the overflow menu. |
| 37 * @private | 45 * @private |
| 38 */ | 46 */ |
| 39 closeMenu_: function() { | 47 closeMenu_: function() { |
| 40 /** @type {CrSharedMenuElement} */(this.$.sharedMenu).closeMenu(); | 48 /** @type {CrSharedMenuElement} */(this.$.sharedMenu).closeMenu(); |
| 41 }, | 49 }, |
| 42 | 50 |
| 43 /** | 51 /** |
| 44 * Opens the overflow menu unless the menu is already open and the same button | 52 * Opens the overflow menu unless the menu is already open and the same button |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 273 |
| 266 /** | 274 /** |
| 267 * @param {number} index | 275 * @param {number} index |
| 268 * @return {boolean} | 276 * @return {boolean} |
| 269 * @private | 277 * @private |
| 270 */ | 278 */ |
| 271 isFirstItem_: function(index) { | 279 isFirstItem_: function(index) { |
| 272 return index == 0; | 280 return index == 0; |
| 273 } | 281 } |
| 274 }); | 282 }); |
| OLD | NEW |