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

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

Issue 2850753002: Prevent opening context menu with all items hidden. (Closed)
Patch Set: Use existing logic to determine whether the item is saparator or not. Created 3 years, 8 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 | 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.js
diff --git a/ui/webui/resources/js/cr/ui/menu.js b/ui/webui/resources/js/cr/ui/menu.js
index 82013972ff9578a923f38903b159d1c1ef527053..512d1069b9b03475cfe377577b4c03c157a0d107 100644
--- a/ui/webui/resources/js/cr/ui/menu.js
+++ b/ui/webui/resources/js/cr/ui/menu.js
@@ -191,7 +191,7 @@ cr.define('cr.ui', function() {
hasVisibleItems: function() {
yoshiki 2017/05/01 06:36:53 nit: I think renaming this to "hasVisibleMenuItem"
yamaguchi 2017/05/01 06:51:46 I guess it's been just "item" because the name of
var menuItems = this.menuItems; // Cache.
for (var i = 0, menuItem; menuItem = menuItems[i]; i++) {
- if (!menuItem.hidden)
+ if (!menuItem.isSeparator() && !menuItem.hidden)
return true;
}
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698