OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // <include src="../../assert.js"> | 5 // <include src="../../assert.js"> |
6 | 6 |
7 cr.exportPath('cr.ui'); | 7 cr.exportPath('cr.ui'); |
8 | 8 |
9 /** | 9 /** |
10 * Enum for type of hide. Delayed is used when called by clicking on a | 10 * Enum for type of hide. Delayed is used when called by clicking on a |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 break; | 243 break; |
244 case 'Enter': | 244 case 'Enter': |
245 case 'U+0020': // Space | 245 case 'U+0020': // Space |
246 if (!this.isMenuShown()) | 246 if (!this.isMenuShown()) |
247 this.showMenu(true); | 247 this.showMenu(true); |
248 e.preventDefault(); | 248 e.preventDefault(); |
249 break; | 249 break; |
250 case 'Esc': | 250 case 'Esc': |
251 case 'U+001B': // Maybe this is remote desktop playing a prank? | 251 case 'U+001B': // Maybe this is remote desktop playing a prank? |
252 case 'U+0009': // Tab | 252 case 'U+0009': // Tab |
253 case 'U+007F': // Delete | |
Bernhard Bauer
2015/04/20 10:46:40
This doesn't seem like the right place to hide the
Deepak
2015/04/20 12:38:35
Thanks for giving me good understanding, I got you
| |
253 this.hideMenu(); | 254 this.hideMenu(); |
254 break; | 255 break; |
255 } | 256 } |
256 } | 257 } |
257 }; | 258 }; |
258 | 259 |
259 /** | 260 /** |
260 * Helper for styling a menu button with a drop-down arrow indicator. | 261 * Helper for styling a menu button with a drop-down arrow indicator. |
261 * Creates a new 2D canvas context and draws a downward-facing arrow into it. | 262 * Creates a new 2D canvas context and draws a downward-facing arrow into it. |
262 * @param {string} canvasName The name of the canvas. The canvas can be | 263 * @param {string} canvasName The name of the canvas. The canvas can be |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
300 'drop-down-arrow-hover', ARROW_WIDTH, ARROW_HEIGHT, opt_hoverColor); | 301 'drop-down-arrow-hover', ARROW_WIDTH, ARROW_HEIGHT, opt_hoverColor); |
301 createDropDownArrowCanvas( | 302 createDropDownArrowCanvas( |
302 'drop-down-arrow-active', ARROW_WIDTH, ARROW_HEIGHT, opt_activeColor); | 303 'drop-down-arrow-active', ARROW_WIDTH, ARROW_HEIGHT, opt_activeColor); |
303 }; | 304 }; |
304 | 305 |
305 // Export | 306 // Export |
306 return { | 307 return { |
307 MenuButton: MenuButton, | 308 MenuButton: MenuButton, |
308 }; | 309 }; |
309 }); | 310 }); |
OLD | NEW |