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

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

Issue 1053123003: [menu.js] Menu.menuItemSelector has to be set before decoration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « ui/file_manager/file_manager/main.html ('k') | 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 81a57ae4e8dde70ec3394b96ab3d1983aa9263e0..6784910acb732879261b9cd2c02c6b67698bd4a5 100644
--- a/ui/webui/resources/js/cr/ui/menu.js
+++ b/ui/webui/resources/js/cr/ui/menu.js
@@ -27,11 +27,6 @@ cr.define('cr.ui', function() {
contextElement: null,
/**
- * Selector for children which are menu items.
- */
- menuItemSelector: '*',
-
- /**
* Initializes the menu element.
*/
decorate: function() {
@@ -119,7 +114,7 @@ cr.define('cr.ui', function() {
},
get menuItems() {
- return this.querySelectorAll(this.menuItemSelector);
+ return this.querySelectorAll(this.menuItemSelector || '*');
},
/**
@@ -272,6 +267,11 @@ cr.define('cr.ui', function() {
cr.defineProperty(Menu, 'selectedIndex', cr.PropertyKind.JS,
selectedIndexChanged);
+ /**
+ * Selector for children which are menu items.
+ */
+ cr.defineProperty(Menu, 'menuItemSelector', cr.PropertyKind.ATTR);
+
// Export
return {
Menu: Menu
« no previous file with comments | « ui/file_manager/file_manager/main.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698