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="../../../../ui/webui/resources/js/cr/ui/focus_row.js"> | 5 <include src="../../../../ui/webui/resources/js/cr/ui/focus_row.js"> |
6 <include src="../../../../ui/webui/resources/js/cr/ui/focus_grid.js"> | 6 <include src="../../../../ui/webui/resources/js/cr/ui/focus_grid.js"> |
7 <include src="../uber/uber_utils.js"> | 7 <include src="../uber/uber_utils.js"> |
8 <include src="extension_code.js"> | 8 <include src="extension_code.js"> |
9 <include src="extension_commands_overlay.js"> | 9 <include src="extension_commands_overlay.js"> |
10 <include src="extension_error_overlay.js"> | 10 <include src="extension_error_overlay.js"> |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
379 document.body.classList.toggle('no-scroll', !!node); | 379 document.body.classList.toggle('no-scroll', !!node); |
380 | 380 |
381 var currentlyShowingOverlay = ExtensionSettings.getCurrentOverlay(); | 381 var currentlyShowingOverlay = ExtensionSettings.getCurrentOverlay(); |
382 if (currentlyShowingOverlay) { | 382 if (currentlyShowingOverlay) { |
383 if (currentlyShowingOverlay == node) // Already displayed. | 383 if (currentlyShowingOverlay == node) // Already displayed. |
384 return; | 384 return; |
385 currentlyShowingOverlay.classList.remove('showing'); | 385 currentlyShowingOverlay.classList.remove('showing'); |
386 } | 386 } |
387 | 387 |
388 if (node) { | 388 if (node) { |
389 var lastFocused = document.activeElement; | 389 var lastFocused; |
390 | |
391 var focusOutlineManager = cr.ui.FocusOutlineManager.forDocument(document); | |
392 if (focusOutlineManager.visible) | |
393 lastFocused = document.activeElement; | |
394 | |
390 $('overlay').addEventListener('cancelOverlay', function f() { | 395 $('overlay').addEventListener('cancelOverlay', function f() { |
391 lastFocused.focus(); | 396 console.log('cancelOverlay'); |
397 console.log('lastFocused', lastFocused); | |
398 console.log('focusOutlineManager.visible', focusOutlineManager.visible); | |
Dan Beam
2015/08/11 02:31:41
^ oops
| |
399 if (lastFocused && focusOutlineManager.visible) | |
400 lastFocused.focus(); | |
401 | |
392 $('overlay').removeEventListener('cancelOverlay', f); | 402 $('overlay').removeEventListener('cancelOverlay', f); |
393 }); | 403 }); |
394 node.classList.add('showing'); | 404 node.classList.add('showing'); |
395 } | 405 } |
396 | 406 |
397 var pages = document.querySelectorAll('.page'); | 407 var pages = document.querySelectorAll('.page'); |
398 for (var i = 0; i < pages.length; i++) { | 408 for (var i = 0; i < pages.length; i++) { |
399 pages[i].setAttribute('aria-hidden', node ? 'true' : 'false'); | 409 pages[i].setAttribute('aria-hidden', node ? 'true' : 'false'); |
400 } | 410 } |
401 | 411 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
464 // Export | 474 // Export |
465 return { | 475 return { |
466 ExtensionSettings: ExtensionSettings | 476 ExtensionSettings: ExtensionSettings |
467 }; | 477 }; |
468 }); | 478 }); |
469 | 479 |
470 window.addEventListener('load', function(e) { | 480 window.addEventListener('load', function(e) { |
471 document.documentElement.classList.add('loading'); | 481 document.documentElement.classList.add('loading'); |
472 extensions.ExtensionSettings.getInstance().initialize(); | 482 extensions.ExtensionSettings.getInstance().initialize(); |
473 }); | 483 }); |
OLD | NEW |