diff --git a/modules/overlay/overlay-parent.css b/modules/overlay/overlay-parent.css index 0cbfc6d040d8954b667fbba324b2abb11bc66a56..99f18eba88441c650cee80ce44416161ec541681 100644 --- a/modules/overlay/overlay-parent.css +++ b/modules/overlay/overlay-parent.css @@ -97,6 +97,10 @@ body.overlay-autofit { overflow: hidden; width: 100%; height: 100%; + visibility: hidden; +} +.overlay-loaded #overlay-element { + visibility: visible; } /** diff --git a/modules/overlay/overlay-parent.js b/modules/overlay/overlay-parent.js index b2f0b16d6a6429ba7fed033fe2701f1d71a5df2d..1cb4f0392ac6c5a6095191172773f8c42f4ce11f 100644 --- a/modules/overlay/overlay-parent.js +++ b/modules/overlay/overlay-parent.js @@ -283,19 +283,17 @@ Drupal.overlay.load = function (url) { // Change the overlay title. self.$container.dialog('option', 'title', Drupal.t('Loading...')); - // When a new overlay is opened and loaded, we add a loaded class to the - // dialog. The loaded class is not removed and added back again while - // switching between pages with the overlay already open, due to - // performance issues (see http://drupal.org/node/615130). + // While the overlay is loading, we remove the loaded class from the dialog. + // After the loading is finished, the loaded class is added back. The loaded + // class is being used to hide the iframe while loading. + // @see overlay-parent.css .overlay-loaded #overlay-element self.$dialog.removeClass('overlay-loaded'); self.$iframe - .css('visibility', 'hidden') .bind('load.overlay-event', function () { self.isLoading = false; // Only continue when overlay is still open and not closing. if (self.isOpen && !self.isClosing) { - self.$iframe.css('visibility', ''); self.$dialog.addClass('overlay-loaded'); } else {