summaryrefslogtreecommitdiffstats
path: root/ui/webui
diff options
context:
space:
mode:
authoryoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-18 09:41:54 +0000
committeryoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-18 09:41:54 +0000
commit7d1af059a2e4573364f290d1a3f9cf3a4c24ef2d (patch)
tree3c4a273cef51d349a7038fa21c6c27aec8280bcc /ui/webui
parent1917d9f547fc6895043ba57c3d492520044581a1 (diff)
downloadchromium_src-7d1af059a2e4573364f290d1a3f9cf3a4c24ef2d.zip
chromium_src-7d1af059a2e4573364f290d1a3f9cf3a4c24ef2d.tar.gz
chromium_src-7d1af059a2e4573364f290d1a3f9cf3a4c24ef2d.tar.bz2
webui: Hide a context menu when the parent window loses focus
BUG=24820 TEST=manually tested R=nkostylev@chromium.org Review URL: https://codereview.chromium.org/27522003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229336 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/webui')
-rw-r--r--ui/webui/resources/js/cr/ui/context_menu_handler.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/webui/resources/js/cr/ui/context_menu_handler.js b/ui/webui/resources/js/cr/ui/context_menu_handler.js
index 0b1cc21..7dc16aa 100644
--- a/ui/webui/resources/js/cr/ui/context_menu_handler.js
+++ b/ui/webui/resources/js/cr/ui/context_menu_handler.js
@@ -53,6 +53,7 @@ cr.define('cr.ui', function() {
this.showingEvents_.add(doc, 'focus', this);
this.showingEvents_.add(win, 'popstate', this);
this.showingEvents_.add(win, 'resize', this);
+ this.showingEvents_.add(win, 'blur', this);
this.showingEvents_.add(menu, 'contextmenu', this);
this.showingEvents_.add(menu, 'activate', this);
this.positionMenu_(e, menu);
@@ -181,6 +182,10 @@ cr.define('cr.ui', function() {
this.hideMenu();
break;
+ case 'blur':
+ this.hideMenu();
+ break;
+
case 'popstate':
case 'resize':
this.hideMenu();