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 22 Feb 2010 23:26:45 -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.27 diff -u -r1.27 overlay-parent.js --- modules/overlay/overlay-parent.js 20 Feb 2010 14:48:38 -0000 1.27 +++ modules/overlay/overlay-parent.js 22 Feb 2010 23:26:45 -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 while loading. clearTimeout(self.resizeTimeoutID); @@ -593,26 +589,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.9 diff -u -r1.9 overlay.module --- modules/overlay/overlay.module 16 Feb 2010 00:27:34 -0000 1.9 +++ modules/overlay/overlay.module 22 Feb 2010 23:26:45 -0000 @@ -462,6 +462,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');