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

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

Issue 9609023: css hack n' slash, continued: New styles for checkboxes and radios. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: csilv review Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 Menu = cr.ui.Menu; 6 const Menu = cr.ui.Menu;
7 const positionPopupAroundElement = cr.ui.positionPopupAroundElement; 7 const positionPopupAroundElement = cr.ui.positionPopupAroundElement;
8 8
9 /** 9 /**
10 * Creates a new menu button element. 10 * Creates a new menu button element.
11 * @param {Object=} opt_propertyBag Optional properties. 11 * @param {Object=} opt_propertyBag Optional properties.
12 * @constructor 12 * @constructor
13 * @extends {HTMLButtonElement} 13 * @extends {HTMLButtonElement}
14 */ 14 */
15 var MenuButton = cr.ui.define('button'); 15 var MenuButton = cr.ui.define('button');
16 16
17 MenuButton.prototype = { 17 MenuButton.prototype = {
18 __proto__: HTMLButtonElement.prototype, 18 __proto__: HTMLButtonElement.prototype,
19 19
20 /** 20 /**
21 * Initializes the menu button. 21 * Initializes the menu button.
22 */ 22 */
23 decorate: function() { 23 decorate: function() {
24 this.addEventListener('mousedown', this); 24 this.addEventListener('mousedown', this);
25 this.addEventListener('keydown', this); 25 this.addEventListener('keydown', this);
26 26
27 // Adding the 'custom-appearance' class prevents button.css from changing 27 // Adding the 'custom-appearance' class prevents widgets.css from changing
28 // the appearance of this element. 28 // the appearance of this element.
29 this.classList.add('custom-appearance'); 29 this.classList.add('custom-appearance');
30 30
31 var menu; 31 var menu;
32 if ((menu = this.getAttribute('menu'))) 32 if ((menu = this.getAttribute('menu')))
33 this.menu = menu; 33 this.menu = menu;
34 34
35 // An event tracker for events we only connect to while the menu is 35 // An event tracker for events we only connect to while the menu is
36 // displayed. 36 // displayed.
37 this.showingEvents_ = new EventTracker(); 37 this.showingEvents_ = new EventTracker();
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 break; 175 break;
176 } 176 }
177 } 177 }
178 }; 178 };
179 179
180 // Export 180 // Export
181 return { 181 return {
182 MenuButton: MenuButton 182 MenuButton: MenuButton
183 }; 183 };
184 }); 184 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/shared/images/checkmark.png ('k') | chrome/browser/resources/shared/js/cr/ui/menu_item.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698