diff options
author | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-18 09:41:54 +0000 |
---|---|---|
committer | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-18 09:41:54 +0000 |
commit | 7d1af059a2e4573364f290d1a3f9cf3a4c24ef2d (patch) | |
tree | 3c4a273cef51d349a7038fa21c6c27aec8280bcc /ui/webui | |
parent | 1917d9f547fc6895043ba57c3d492520044581a1 (diff) | |
download | chromium_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.js | 5 |
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(); |