Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: ui/webui/resources/js/cr/ui/overlay.js

Issue 22661007: Make the body not scrollable and make a scrollable container div to host #extension-settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to higher level of overlay. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/webui/resources/css/overlay.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/overlay.js
diff --git a/ui/webui/resources/js/cr/ui/overlay.js b/ui/webui/resources/js/cr/ui/overlay.js
index 5c0acb2d3dd826d52e3f76e1a3de7b7127671043..694f49a86e65062491393459e7967a70af4d393a 100644
--- a/ui/webui/resources/js/cr/ui/overlay.js
+++ b/ui/webui/resources/js/cr/ui/overlay.js
@@ -88,6 +88,17 @@ cr.define('cr.ui.overlay', function() {
}
/**
+ * Called when a overlay is shown or hidden to update the scrollability of
+ * root document body based on this overlay's visibility.
+ */
+ function onVisibilityChanged(visible) {
xiyuan 2013/08/13 17:23:35 |visible| is mis-leading. It looks more like hidde
zhchbin 2013/08/14 06:54:30 Done.
+ if (visible)
+ document.body.classList.remove('no-scroll');
+ else
+ document.body.classList.add('no-scroll');
+ }
+
+ /**
* Adds behavioral hooks for the given overlay.
* @param {HTMLElement} overlay The .overlay.
*/
@@ -103,6 +114,9 @@ cr.define('cr.ui.overlay', function() {
// Remove the 'pulse' animation any time the overlay is hidden or shown.
overlay.__defineSetter__('hidden', function(value) {
this.classList.remove('pulse');
+ if (value != this.hasAttribute('hidden'))
+ onVisibilityChanged(value);
+
if (value)
this.setAttribute('hidden', true);
else
« no previous file with comments | « ui/webui/resources/css/overlay.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698