| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** | 5 /** |
| 6 * @fileoverview An item in a drop-down menu in the ChromeVox panel. | 6 * @fileoverview An item in a drop-down menu in the ChromeVox panel. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 goog.provide('PanelMenuItem'); | 9 goog.provide('PanelMenuItem'); |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 this.element.tabIndex = -1; | 24 this.element.tabIndex = -1; |
| 25 this.element.setAttribute('role', 'menuitem'); | 25 this.element.setAttribute('role', 'menuitem'); |
| 26 | 26 |
| 27 this.element.addEventListener('mouseover', (function(evt) { | 27 this.element.addEventListener('mouseover', (function(evt) { |
| 28 this.element.focus(); | 28 this.element.focus(); |
| 29 }).bind(this), false); | 29 }).bind(this), false); |
| 30 | 30 |
| 31 var title = document.createElement('td'); | 31 var title = document.createElement('td'); |
| 32 title.className = 'menu-item-title'; | 32 title.className = 'menu-item-title'; |
| 33 title.textContent = menuItemTitle; | 33 title.textContent = menuItemTitle; |
| 34 |
| 35 // Tooltip in case the menu item is cut off. |
| 36 title.title = menuItemTitle; |
| 34 this.element.appendChild(title); | 37 this.element.appendChild(title); |
| 35 | 38 |
| 36 var shortcut = document.createElement('td'); | 39 var shortcut = document.createElement('td'); |
| 37 shortcut.className = 'menu-item-shortcut'; | 40 shortcut.className = 'menu-item-shortcut'; |
| 38 shortcut.textContent = menuItemShortcut; | 41 shortcut.textContent = menuItemShortcut; |
| 39 this.element.appendChild(shortcut); | 42 this.element.appendChild(shortcut); |
| 40 | 43 |
| 41 if (localStorage['brailleCaptions'] === String(true)) { | 44 if (localStorage['brailleCaptions'] === String(true)) { |
| 42 var braille = document.createElement('td'); | 45 var braille = document.createElement('td'); |
| 43 braille.className = 'menu-item-shortcut'; | 46 braille.className = 'menu-item-shortcut'; |
| 44 braille.textContent = menuItemBraille; | 47 braille.textContent = menuItemBraille; |
| 45 this.element.appendChild(braille); | 48 this.element.appendChild(braille); |
| 46 } | 49 } |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 PanelMenuItem.prototype = { | 52 PanelMenuItem.prototype = { |
| 50 get text() { | 53 get text() { |
| 51 return this.element.textContent; | 54 return this.element.textContent; |
| 52 } | 55 } |
| 53 }; | 56 }; |
| OLD | NEW |