OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ChromeVox options page. | 6 * @fileoverview ChromeVox options page. |
7 * | 7 * |
8 */ | 8 */ |
9 | 9 |
10 goog.provide('cvox.OptionsPage'); | 10 goog.provide('cvox.OptionsPage'); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 }; | 270 }; |
271 }; | 271 }; |
272 | 272 |
273 select6.addEventListener('change', handleBrailleSelect(select6), true); | 273 select6.addEventListener('change', handleBrailleSelect(select6), true); |
274 select8.addEventListener('change', handleBrailleSelect(select8), true); | 274 select8.addEventListener('change', handleBrailleSelect(select8), true); |
275 | 275 |
276 var tableTypeButton = $('brailleTableType'); | 276 var tableTypeButton = $('brailleTableType'); |
277 var updateTableType = function(setFocus) { | 277 var updateTableType = function(setFocus) { |
278 var currentTableType = localStorage['brailleTableType'] || 'brailleTable6'; | 278 var currentTableType = localStorage['brailleTableType'] || 'brailleTable6'; |
279 if (currentTableType == 'brailleTable6') { | 279 if (currentTableType == 'brailleTable6') { |
280 select6.removeAttribute('aria-hidden'); | 280 select6.parentElement.style.display = 'block'; |
281 select6.setAttribute('tabIndex', 0); | 281 select8.parentElement.style.display = 'none'; |
282 select6.style.display = 'block'; | |
283 if (setFocus) { | 282 if (setFocus) { |
284 select6.focus(); | 283 select6.focus(); |
285 } | 284 } |
286 select8.setAttribute('aria-hidden', 'true'); | |
287 select8.setAttribute('tabIndex', -1); | |
288 select8.style.display = 'none'; | |
289 localStorage['brailleTable'] = localStorage['brailleTable6']; | 285 localStorage['brailleTable'] = localStorage['brailleTable6']; |
290 localStorage['brailleTableType'] = 'brailleTable6'; | 286 localStorage['brailleTableType'] = 'brailleTable6'; |
291 tableTypeButton.textContent = | 287 tableTypeButton.textContent = |
292 Msgs.getMsg('options_braille_table_type_6'); | 288 Msgs.getMsg('options_braille_table_type_6'); |
293 } else { | 289 } else { |
294 select6.setAttribute('aria-hidden', 'true'); | 290 select6.parentElement.style.display = 'none'; |
295 select6.setAttribute('tabIndex', -1); | 291 select8.parentElement.style.display = 'block'; |
296 select6.style.display = 'none'; | |
297 select8.removeAttribute('aria-hidden'); | |
298 select8.setAttribute('tabIndex', 0); | |
David Tseng
2017/03/28 01:04:26
They you test this with the tab key? It was a litt
dmazzoni
2017/03/28 17:28:28
I tested this with Tab and with ChromeVox navigati
| |
299 select8.style.display = 'block'; | |
300 if (setFocus) { | 292 if (setFocus) { |
301 select8.focus(); | 293 select8.focus(); |
302 } | 294 } |
303 localStorage['brailleTable'] = localStorage['brailleTable8']; | 295 localStorage['brailleTable'] = localStorage['brailleTable8']; |
304 localStorage['brailleTableType'] = 'brailleTable8'; | 296 localStorage['brailleTableType'] = 'brailleTable8'; |
305 tableTypeButton.textContent = | 297 tableTypeButton.textContent = |
306 Msgs.getMsg('options_braille_table_type_8'); | 298 Msgs.getMsg('options_braille_table_type_8'); |
307 } | 299 } |
308 cvox.OptionsPage.getBrailleTranslatorManager().refresh(); | 300 cvox.OptionsPage.getBrailleTranslatorManager().refresh(); |
309 }; | 301 }; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 /** | 374 /** |
383 * @return {cvox.BrailleTranslatorManager} | 375 * @return {cvox.BrailleTranslatorManager} |
384 */ | 376 */ |
385 cvox.OptionsPage.getBrailleTranslatorManager = function() { | 377 cvox.OptionsPage.getBrailleTranslatorManager = function() { |
386 return chrome.extension.getBackgroundPage()['braille_translator_manager']; | 378 return chrome.extension.getBackgroundPage()['braille_translator_manager']; |
387 }; | 379 }; |
388 | 380 |
389 document.addEventListener('DOMContentLoaded', function() { | 381 document.addEventListener('DOMContentLoaded', function() { |
390 cvox.OptionsPage.init(); | 382 cvox.OptionsPage.init(); |
391 }, false); | 383 }, false); |
OLD | NEW |