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="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
6 <include src="extension_code.js"> | 6 <include src="extension_code.js"> |
7 <include src="extension_commands_overlay.js"> | 7 <include src="extension_commands_overlay.js"> |
8 <include src="extension_error_overlay.js"> | 8 <include src="extension_error_overlay.js"> |
9 <include src="extension_focus_manager.js"> | 9 <include src="extension_focus_manager.js"> |
10 <include src="extension_list.js"> | 10 <include src="extension_list.js"> |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 373 |
374 /** | 374 /** |
375 * Sets the given overlay to show. This hides whatever overlay is currently | 375 * Sets the given overlay to show. This hides whatever overlay is currently |
376 * showing, if any. | 376 * showing, if any. |
377 * @param {HTMLElement} node The overlay page to show. If null, all overlays | 377 * @param {HTMLElement} node The overlay page to show. If null, all overlays |
378 * are hidden. | 378 * are hidden. |
379 */ | 379 */ |
380 ExtensionSettings.showOverlay = function(node) { | 380 ExtensionSettings.showOverlay = function(node) { |
381 var pageDiv = $('extension-settings'); | 381 var pageDiv = $('extension-settings'); |
382 pageDiv.style.width = node ? window.getComputedStyle(pageDiv).width : ''; | 382 pageDiv.style.width = node ? window.getComputedStyle(pageDiv).width : ''; |
383 document.body.classList.toggle('no-scroll', node); | 383 document.body.classList.toggle('no-scroll', !!node); |
384 | 384 |
385 var currentlyShowingOverlay = ExtensionSettings.getCurrentOverlay(); | 385 var currentlyShowingOverlay = ExtensionSettings.getCurrentOverlay(); |
386 if (currentlyShowingOverlay) { | 386 if (currentlyShowingOverlay) { |
387 currentlyShowingOverlay.classList.remove('showing'); | 387 currentlyShowingOverlay.classList.remove('showing'); |
388 cr.dispatchSimpleEvent($('overlay'), 'cancelOverlay'); | 388 cr.dispatchSimpleEvent($('overlay'), 'cancelOverlay'); |
389 } | 389 } |
390 | 390 |
391 if (node) { | 391 if (node) { |
392 var lastFocused = document.activeElement; | 392 var lastFocused = document.activeElement; |
393 $('overlay').addEventListener('cancelOverlay', function f() { | 393 $('overlay').addEventListener('cancelOverlay', function f() { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 459 |
460 // Export | 460 // Export |
461 return { | 461 return { |
462 ExtensionSettings: ExtensionSettings | 462 ExtensionSettings: ExtensionSettings |
463 }; | 463 }; |
464 }); | 464 }); |
465 | 465 |
466 window.addEventListener('load', function(e) { | 466 window.addEventListener('load', function(e) { |
467 extensions.ExtensionSettings.getInstance().initialize(); | 467 extensions.ExtensionSettings.getInstance().initialize(); |
468 }); | 468 }); |
OLD | NEW |