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

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

Issue 2926233002: MD Bookmarks: Add right-click context menu to sidebar folders (Closed)
Patch Set: Don't reselect folder Created 3 years, 6 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/folder_node.js
diff --git a/chrome/browser/resources/md_bookmarks/folder_node.js b/chrome/browser/resources/md_bookmarks/folder_node.js
index 77aa437568d3291841925985f95df4a4afcfcad3..c6885cecd50d592923c7b65ad115a2d6ecbd63c3 100644
--- a/chrome/browser/resources/md_bookmarks/folder_node.js
+++ b/chrome/browser/resources/md_bookmarks/folder_node.js
@@ -259,8 +259,21 @@ Polymer({
/** @private */
selectFolder_: function() {
- this.dispatch(
- bookmarks.actions.selectFolder(this.item_.id, this.getState().nodes));
+ if (!this.isSelectedFolder_) {
+ this.dispatch(
+ bookmarks.actions.selectFolder(this.itemId, this.getState().nodes));
+ }
+ },
+
+ /**
+ * @param {!Event} e
+ * @private
+ */
+ onContextMenu_: function(e) {
+ e.preventDefault();
+ this.selectFolder_();
+ bookmarks.CommandManager.getInstance().openCommandMenuAtPosition(
+ e.clientX, e.clientY, new Set([this.itemId]));
},
/**
@@ -278,7 +291,7 @@ Polymer({
*/
toggleFolder_: function(e) {
this.dispatch(
- bookmarks.actions.changeFolderOpen(this.item_.id, this.isClosed_));
+ bookmarks.actions.changeFolderOpen(this.itemId, this.isClosed_));
e.stopPropagation();
},
« no previous file with comments | « chrome/browser/resources/md_bookmarks/folder_node.html ('k') | chrome/test/data/webui/md_bookmarks/folder_node_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698