OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 Polymer({ |
| 6 is: 'bookmarks-list', |
| 7 |
| 8 properties: { |
| 9 /** @type {BookmarkTreeNode} */ |
| 10 selectedNode: Object, |
| 11 }, |
| 12 |
| 13 listeners: { |
| 14 'toggle-menu': 'onToggleMenu_' |
| 15 }, |
| 16 |
| 17 /** |
| 18 * @param {Event} e |
| 19 * @private |
| 20 */ |
| 21 onToggleMenu_: function(e) { |
| 22 var menu = /** @type {!CrActionMenuElement} */ ( |
| 23 this.$.dropdown); |
| 24 menu.showAt(/** @type {!Element} */ (e.detail.target)); |
| 25 }, |
| 26 |
| 27 // TODO(jiaxi): change these dummy click event handlers later. |
| 28 /** @private */ |
| 29 onEditTap_: function() { |
| 30 this.closeDropdownMenu_(); |
| 31 }, |
| 32 |
| 33 /** @private */ |
| 34 onCopyURLTap_: function() { |
| 35 this.closeDropdownMenu_(); |
| 36 }, |
| 37 |
| 38 /** @private */ |
| 39 onDeleteTap_: function() { |
| 40 this.closeDropdownMenu_(); |
| 41 }, |
| 42 |
| 43 /** @private */ |
| 44 closeDropdownMenu_: function() { |
| 45 var menu = /** @type {!CrActionMenuElement} */ ( |
| 46 this.$.dropdown); |
| 47 menu.close(); |
| 48 } |
| 49 }); |
OLD | NEW |