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..c38b6da7fa26e40059358dcc22a4fc61dd45653d 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.closeDropdownMenu_(); |
+ }, |
+ |
/** @private */ |
closeDropdownMenu_: function() { |
var menu = /** @type {!CrActionMenuElement} */ ( |