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

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

Issue 1178783003: Add menuhide event to menu button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove initUIEvent. Created 5 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
« no previous file with comments | « chrome/test/data/webui/webui_resource_browsertest.cc ('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_button.js
diff --git a/ui/webui/resources/js/cr/ui/menu_button.js b/ui/webui/resources/js/cr/ui/menu_button.js
index e7f9804309c452f633e4dd7c203d809554584023..a688581afd53a201c6bb2e77a518411f9e46e7b3 100644
--- a/ui/webui/resources/js/cr/ui/menu_button.js
+++ b/ui/webui/resources/js/cr/ui/menu_button.js
@@ -181,9 +181,11 @@ cr.define('cr.ui', function() {
this.menu.updateCommands(this);
- var event = document.createEvent('UIEvents');
- event.initUIEvent('menushow', true, true, window, null);
-
+ var event = new UIEvent('menushow',{
+ bubbles: true,
+ cancelable: true,
+ view: window
+ });
if (!this.dispatchEvent(event))
return;
@@ -228,6 +230,13 @@ cr.define('cr.ui', function() {
this.showingEvents_.removeAll();
this.focus();
+ var event = new UIEvent('menuhide', {
+ bubbles: true,
+ cancelable: false,
+ view: window
+ });
+ this.dispatchEvent(event);
+
// On windows we might hide the menu in a right mouse button up and if
// that is the case we wait some short period before we allow the menu
// to be shown again.
« no previous file with comments | « chrome/test/data/webui/webui_resource_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698