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"></include> | 5 <include src="../uber/uber_utils.js"></include> |
6 <include src="extension_commands_overlay.js"></include> | 6 <include src="extension_commands_overlay.js"></include> |
7 <include src="extension_focus_manager.js"></include> | 7 <include src="extension_focus_manager.js"></include> |
8 <include src="extension_list.js"></include> | 8 <include src="extension_list.js"></include> |
9 <include src="pack_extension_overlay.js"></include> | 9 <include src="pack_extension_overlay.js"></include> |
10 | 10 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 return document.querySelector('#overlay .page.showing'); | 349 return document.querySelector('#overlay .page.showing'); |
350 } | 350 } |
351 | 351 |
352 /** | 352 /** |
353 * Sets the given overlay to show. This hides whatever overlay is currently | 353 * Sets the given overlay to show. This hides whatever overlay is currently |
354 * showing, if any. | 354 * showing, if any. |
355 * @param {HTMLElement} node The overlay page to show. If falsey, all overlays | 355 * @param {HTMLElement} node The overlay page to show. If falsey, all overlays |
356 * are hidden. | 356 * are hidden. |
357 */ | 357 */ |
358 ExtensionSettings.showOverlay = function(node) { | 358 ExtensionSettings.showOverlay = function(node) { |
| 359 var pageDiv = $('extension-settings'); |
| 360 if (node) { |
| 361 pageDiv.style.width = window.getComputedStyle(pageDiv).width; |
| 362 document.body.classList.add('no-scroll'); |
| 363 } else { |
| 364 document.body.classList.remove('no-scroll'); |
| 365 pageDiv.style.width = ''; |
| 366 } |
| 367 |
359 var currentlyShowingOverlay = ExtensionSettings.getCurrentOverlay(); | 368 var currentlyShowingOverlay = ExtensionSettings.getCurrentOverlay(); |
360 if (currentlyShowingOverlay) | 369 if (currentlyShowingOverlay) |
361 currentlyShowingOverlay.classList.remove('showing'); | 370 currentlyShowingOverlay.classList.remove('showing'); |
362 | 371 |
363 if (node) | 372 if (node) |
364 node.classList.add('showing'); | 373 node.classList.add('showing'); |
365 | 374 |
366 var pages = document.querySelectorAll('.page'); | 375 var pages = document.querySelectorAll('.page'); |
367 for (var i = 0; i < pages.length; i++) { | 376 for (var i = 0; i < pages.length; i++) { |
368 pages[i].setAttribute('aria-hidden', node ? 'true' : 'false'); | 377 pages[i].setAttribute('aria-hidden', node ? 'true' : 'false'); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 | 414 |
406 // Export | 415 // Export |
407 return { | 416 return { |
408 ExtensionSettings: ExtensionSettings | 417 ExtensionSettings: ExtensionSettings |
409 }; | 418 }; |
410 }); | 419 }); |
411 | 420 |
412 window.addEventListener('load', function(e) { | 421 window.addEventListener('load', function(e) { |
413 extensions.ExtensionSettings.getInstance().initialize(); | 422 extensions.ExtensionSettings.getInstance().initialize(); |
414 }); | 423 }); |
OLD | NEW |