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

Side by Side Diff: chrome/browser/resources/shared/js/cr/ui/menu_item.js

Issue 2863031: Change MenuItems to use divs and add disabled property (Closed)
Patch Set: Should extend div not button. Created 10 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('cr.ui', function() { 5 cr.define('cr.ui', function() {
6 const Command = cr.ui.Command; 6 const Command = cr.ui.Command;
7 7
8 /** 8 /**
9 * Creates a new menu item element. 9 * Creates a new menu item element.
10 * @param {Object=} opt_propertyBag Optional properties. 10 * @param {Object=} opt_propertyBag Optional properties.
11 * @constructor 11 * @constructor
12 * @extends {HTMLButtonElement} 12 * @extends {HTMLDivElement}
13 */ 13 */
14 var MenuItem = cr.ui.define('button'); 14 var MenuItem = cr.ui.define('div');
15 15
16 /** 16 /**
17 * Creates a new menu separator element. 17 * Creates a new menu separator element.
18 * @return {cr.ui.MenuItem} 18 * @return {cr.ui.MenuItem}
19 */ 19 */
20 MenuItem.createSeparator = function() { 20 MenuItem.createSeparator = function() {
21 var el = cr.doc.createElement('hr'); 21 var el = cr.doc.createElement('hr');
22 MenuItem.decorate(el); 22 MenuItem.decorate(el);
23 return el; 23 return el;
24 }; 24 };
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 this.hidden = this.command.hidden; 122 this.hidden = this.command.hidden;
123 break; 123 break;
124 case 'labelChange': 124 case 'labelChange':
125 this.label = this.command.label; 125 this.label = this.command.label;
126 break; 126 break;
127 } 127 }
128 } 128 }
129 }; 129 };
130 130
131 /** 131 /**
132 * Whether the menu item is disabled or not.
133 * @type {boolean}
134 */
135 cr.defineProperty(MenuItem, 'disabled', cr.PropertyKind.BOOL_ATTR);
136
137 /**
132 * Whether the menu item is hidden or not. 138 * Whether the menu item is hidden or not.
133 * @type {boolean} 139 * @type {boolean}
134 */ 140 */
135 cr.defineProperty(MenuItem, 'hidden', cr.PropertyKind.BOOL_ATTR); 141 cr.defineProperty(MenuItem, 'hidden', cr.PropertyKind.BOOL_ATTR);
136 142
137 /** 143 /**
138 * Whether the menu item is selected or not. 144 * Whether the menu item is selected or not.
139 * @type {boolean} 145 * @type {boolean}
140 */ 146 */
141 cr.defineProperty(MenuItem, 'selected', cr.PropertyKind.BOOL_ATTR); 147 cr.defineProperty(MenuItem, 'selected', cr.PropertyKind.BOOL_ATTR);
142 148
143 // Export 149 // Export
144 return { 150 return {
145 MenuItem: MenuItem 151 MenuItem: MenuItem
146 }; 152 };
147 }); 153 });
OLDNEW
« 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