diff options
author | hirono@chromium.org <hirono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-01 07:19:57 +0000 |
---|---|---|
committer | hirono@chromium.org <hirono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-01 07:19:57 +0000 |
commit | de211db665b63fe75cfc41dbb75648e5ac2e0670 (patch) | |
tree | 8d9399401a3db80fdbdf21318b5e62ffc67e363f /ui/webui | |
parent | b5fa4ee1544057ed2b329612c4bdaf4369adcb70 (diff) | |
download | chromium_src-de211db665b63fe75cfc41dbb75648e5ac2e0670.zip chromium_src-de211db665b63fe75cfc41dbb75648e5ac2e0670.tar.gz chromium_src-de211db665b63fe75cfc41dbb75648e5ac2e0670.tar.bz2 |
Originally MenuButton can show the empty menu but operating the empty menu by keyboard caused to freeze.
This CL adds a guard and prevents MenuButton from opening the empty menu.
BUG=244300
TEST=manually
Review URL: https://codereview.chromium.org/25211002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/webui')
-rw-r--r-- | ui/webui/resources/js/cr/ui/menu_button.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/webui/resources/js/cr/ui/menu_button.js b/ui/webui/resources/js/cr/ui/menu_button.js index 8a34919..6130abd 100644 --- a/ui/webui/resources/js/cr/ui/menu_button.js +++ b/ui/webui/resources/js/cr/ui/menu_button.js @@ -149,6 +149,9 @@ cr.define('cr.ui', function() { showMenu: function(shouldSetFocus) { this.hideMenu(); + if (!this.menu.length) + return; + this.menu.updateCommands(this); var event = document.createEvent('UIEvents'); |