Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4651)

Unified Diff: chrome/browser/resources/md_bookmarks/list.js

Issue 2814023004: [MD Bookmarks] Right click on bookmark items open context menu. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 19e475d0e9456f766b3aa99b219b226fa16346d2..fca7c4a62c547ed6a3c6b68417205b658cf13706 100644
--- a/chrome/browser/resources/md_bookmarks/list.js
+++ b/chrome/browser/resources/md_bookmarks/list.js
@@ -50,7 +50,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 */
@@ -83,6 +90,17 @@ Polymer({
this.closeDropdownMenu_();
},
+ /**
+ * @param {Event} e
tsergeant 2017/04/13 01:15:47 I think you should add a small comment here to sho
calamity 2017/04/13 04:56:46 Done.
+ * @private
+ */
+ onMenuMousedown_: function(e) {
+ if (e.path[0] != this.$.dropdown)
+ return;
+
+ this.$.dropdown.close();
+ },
+
/** @private */
closeDropdownMenu_: function() {
var menu = /** @type {!CrActionMenuElement} */ (

Powered by Google App Engine
This is Rietveld 408576698