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

Unified Diff: ui/webui/resources/js/cr/ui/menu.js

Issue 1058873009: Bookmark manager: Pass in explicit targets to the delete and rename commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: review Created 5 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 | « chrome/browser/resources/bookmark_manager/js/main.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/menu.js
diff --git a/ui/webui/resources/js/cr/ui/menu.js b/ui/webui/resources/js/cr/ui/menu.js
index 6784910acb732879261b9cd2c02c6b67698bd4a5..22d93b4dba6db32f07f4e4b3a61be7454d807ddf 100644
--- a/ui/webui/resources/js/cr/ui/menu.js
+++ b/ui/webui/resources/js/cr/ui/menu.js
@@ -221,12 +221,15 @@ cr.define('cr.ui', function() {
case 'Enter':
case 'U+0020': // Space
if (item) {
+ // Store |contextElement| since it'll be removed when handling the
+ // 'activate' event.
+ var contextElement = this.contextElement;
var activationEvent = cr.doc.createEvent('Event');
activationEvent.initEvent('activate', true, true);
activationEvent.originalEvent = e;
if (item.dispatchEvent(activationEvent)) {
if (item.command)
- item.command.execute();
+ item.command.execute(contextElement);
}
}
return true;
« no previous file with comments | « chrome/browser/resources/bookmark_manager/js/main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698