Index: chrome/browser/resources/md_bookmarks/list.js |
diff --git a/chrome/browser/resources/md_bookmarks/list.js b/chrome/browser/resources/md_bookmarks/list.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e24f5f70289863cb9f329c86ffbc211680eb03d6 |
--- /dev/null |
+++ b/chrome/browser/resources/md_bookmarks/list.js |
@@ -0,0 +1,50 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+Polymer({ |
+ is: 'bookmarks-list', |
+ properties: { |
+ /** @type {BookmarkTreeNode} */ |
+ selectedNode: { |
+ type: Object |
+ }, |
calamity
2017/01/04 00:43:00
selectedNode: Object,
jiaxi
2017/01/04 02:50:16
Done.
|
+ }, |
+ |
+ listeners: { |
+ 'toggle-menu': 'toggleMenu_' |
tsergeant
2017/01/03 23:31:17
Prefer to name event listeners as `onEventName`, s
jiaxi
2017/01/04 02:50:16
Done.
|
+ }, |
+ |
+ /** |
+ * @param {Event} e |
+ * @private |
+ */ |
+ toggleMenu_: function(e) { |
+ var menu = /** @type {!CrActionMenuElement} */ ( |
+ this.$.dropdown); |
+ menu.showAt(/** @type {!Element} */ (e.detail.target)); |
+ }, |
+ |
+ // TODO(jiaxi): change these dummy click event holders later. |
calamity
2017/01/04 00:43:00
handlers?
jiaxi
2017/01/04 02:50:16
Done.
|
+ /** @private */ |
+ onEditTap_: function() { |
+ this.closeDropdownMenu_(); |
+ }, |
+ |
+ /** @private */ |
+ onCopyURLTap_: function() { |
+ this.closeDropdownMenu_(); |
+ }, |
+ |
+ /** @private */ |
+ onDeleteTap_: function() { |
+ this.closeDropdownMenu_(); |
+ }, |
+ |
+ /** @private */ |
+ closeDropdownMenu_: function() { |
+ var menu = /** @type {!CrActionMenuElement} */ ( |
+ this.$.dropdown); |
+ menu.close(); |
+ } |
+}); |