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

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

Issue 22154002: Not to show context menu if there are no visible items to show. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comment Created 7 years, 4 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 | « no previous file | ui/webui/resources/js/cr/ui/menu.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/context_menu_handler.js
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 30ab13c695e77f11a05345d62ba5082689ffd4a8..05264d6ee3b7dbb2a29635fcff7071e8027e1c23 100644
--- a/ui/webui/resources/js/cr/ui/context_menu_handler.js
+++ b/ui/webui/resources/js/cr/ui/context_menu_handler.js
@@ -35,8 +35,11 @@ cr.define('cr.ui', function() {
* @param {!cr.ui.Menu} menu The menu to show.
*/
showMenu: function(e, menu) {
- this.menu_ = menu;
menu.updateCommands(e.currentTarget);
+ if (!menu.hasVisibleItems())
+ return;
+
+ this.menu_ = menu;
menu.classList.remove('hide-delayed');
menu.hidden = false;
menu.contextElement = e.currentTarget;
« no previous file with comments | « no previous file | ui/webui/resources/js/cr/ui/menu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698