Chromium Code Reviews| 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 |
| index 6952696a2e86c6bfd41384d541fb3a3b33d92d07..5ee5454ff6110c8f05731a22a230561b7dc6f5f3 100644 |
| --- a/chrome/browser/resources/md_bookmarks/list.js |
| +++ b/chrome/browser/resources/md_bookmarks/list.js |
| @@ -54,7 +54,14 @@ Polymer({ |
| this.menuItem_ = e.detail.item; |
| var menu = /** @type {!CrActionMenuElement} */ ( |
| this.$.dropdown); |
| - menu.showAt(/** @type {!Element} */ (e.detail.target)); |
| + if (e.detail.targetElement) { |
| + menu.showAt(/** @type {!Element} */ (e.detail.targetElement)); |
| + } else { |
| + menu.showAtPosition({ |
| + top: e.detail.y, |
| + left: e.detail.x, |
| + }); |
| + } |
| }, |
| /** @private */ |
| @@ -87,6 +94,20 @@ Polymer({ |
| this.closeDropdownMenu_(); |
| }, |
| + /** |
| + * Close the menu on mousedown so clicks can propagate to the underlying UI. |
| + * This allows the user to right click the list while a context menu is |
| + * showing and get another context menu. |
| + * @param {Event} e |
| + * @private |
| + */ |
| + onMenuMousedown_: function(e) { |
| + if (e.path[0] != this.$.dropdown) |
| + return; |
| + |
| + this.$.dropdown.close(); |
|
tsergeant
2017/04/13 05:48:25
nit: call this.closeDropdownMenu_()
calamity
2017/04/19 05:36:34
Done.
|
| + }, |
| + |
| /** @private */ |
| closeDropdownMenu_: function() { |
| var menu = /** @type {!CrActionMenuElement} */ ( |