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

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

Issue 2814023004: [MD Bookmarks] Right click on bookmark items open context menu. (Closed)
Patch Set: fix_nit 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
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/list.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_bookmarks/item.js
diff --git a/chrome/browser/resources/md_bookmarks/item.js b/chrome/browser/resources/md_bookmarks/item.js
index d761f6532353608694cbc410f521a5a6be321403..66596de964494e8a76f25819fffe60e7f55ccc89 100644
--- a/chrome/browser/resources/md_bookmarks/item.js
+++ b/chrome/browser/resources/md_bookmarks/item.js
@@ -38,6 +38,7 @@ Polymer({
listeners: {
'click': 'onClick_',
'dblclick': 'onDblClick_',
+ 'contextmenu': 'onContextMenu_',
},
/** @override */
@@ -61,12 +62,29 @@ Polymer({
* @param {Event} e
* @private
*/
+ onContextMenu_: function(e) {
+ e.preventDefault();
+ if (!this.isSelectedItem_) {
+ this.dispatch(bookmarks.actions.selectItem(
+ this.itemId, false, false, this.getState()));
+ }
+ this.fire('open-item-menu', {
+ x: e.clientX,
+ y: e.clientY,
+ item: this.item_,
+ });
+ },
+
+ /**
+ * @param {Event} e
+ * @private
+ */
onMenuButtonClick_: function(e) {
e.stopPropagation();
this.dispatch(bookmarks.actions.selectItem(
this.itemId, false, false, this.getState()));
this.fire('open-item-menu', {
- target: e.target,
+ targetElement: e.target,
item: this.item_,
});
},
« no previous file with comments | « no previous file | chrome/browser/resources/md_bookmarks/list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698