Index: modules/overlay/overlay-parent.css =================================================================== RCS file: /cvs/drupal/drupal/modules/overlay/overlay-parent.css,v retrieving revision 1.10 diff -u -r1.10 overlay-parent.css --- modules/overlay/overlay-parent.css 18 Jan 2010 03:29:51 -0000 1.10 +++ modules/overlay/overlay-parent.css 11 Feb 2010 13:44:47 -0000 @@ -88,19 +88,12 @@ padding: 0; width: 100%; overflow: visible; - background: #fff url(images/loading.gif) no-repeat 50% 50%; -} -.overlay-loaded #overlay-container { background: #fff; } .overlay #overlay-element { overflow: hidden; width: 100%; height: 100%; - display: none; -} -.overlay-loaded #overlay-element { - display: block; } /** Index: modules/overlay/overlay-parent.js =================================================================== RCS file: /cvs/drupal/drupal/modules/overlay/overlay-parent.js,v retrieving revision 1.26 diff -u -r1.26 overlay-parent.js --- modules/overlay/overlay-parent.js 10 Feb 2010 05:50:49 -0000 1.26 +++ modules/overlay/overlay-parent.js 11 Feb 2010 13:44:47 -0000 @@ -277,10 +277,6 @@ self.$iframeDocument = null; self.$iframeBody = null; - // Reset lastHeight so the overlay fits user's viewport and the loading - // spinner is centered. - self.lastHeight = 0; - self.outerResize(); // No need to resize when loading. clearTimeout(self.resizeTimeoutID); @@ -581,26 +577,25 @@ * Note, though, that the size of the iframe itself may affect the size of the * child document, especially on fluid layouts. */ -Drupal.overlay.innerResize = function () { +Drupal.overlay.innerResize = function (height) { var self = Drupal.overlay; // Proceed only if the dialog still exists. - if (!self.isOpen || self.isClosing || self.isLoading) { + if (!self.isOpen || self.isClosing) { return; } - var height; - // Only set height when iframe content is loaded. - if ($.isObject(self.$iframeBody)) { + // When no height is given try to get height when iframe content is loaded. + if (!height && $.isObject(self.$iframeBody)) { height = self.$iframeBody.outerHeight() + 25; - - // Only resize when height actually is changed. - if (height != self.lastHeight) { - - // Resize the container. - self.$container.height(height); - // Keep the dim background grow or shrink with the dialog. - $.ui.dialog.overlay.resize(); - } + } + + // Only resize when height actually is changed. + if (height && height != self.lastHeight) { + // Resize the container. + self.$container.height(height); + // Keep the dim background grow or shrink with the dialog. + $.ui.dialog.overlay.resize(); + self.lastHeight = height; } }; Index: modules/overlay/overlay.module =================================================================== RCS file: /cvs/drupal/drupal/modules/overlay/overlay.module,v retrieving revision 1.8 diff -u -r1.8 overlay.module --- modules/overlay/overlay.module 18 Jan 2010 17:12:04 -0000 1.8 +++ modules/overlay/overlay.module 11 Feb 2010 13:44:47 -0000 @@ -461,6 +461,9 @@ case 'child': drupal_add_library('overlay', 'child'); + // Pass child's document height on to parent document as quickly as + // possible so it can be updated accordingly. + drupal_add_js('if (jQuery.isObject(parent.Drupal) && jQuery.isObject(parent.Drupal.overlay)) { parent.Drupal.overlay.innerResize(jQuery(document.body).outerHeight()); }', array('type' => 'inline', 'scope' => 'footer')); // Allow modules to act upon overlay events. module_invoke_all('overlay_child_initialize');