- Patch #667074 by casey, Kiphaas7, David_Rothstein: the spinner's visibility can be defined in CSS rather than JS.

merge-requests/26/head
Dries Buytaert 2010-01-06 19:01:43 +00:00
parent 8a07a7895c
commit da4c58c010
2 changed files with 8 additions and 6 deletions

View File

@ -97,6 +97,10 @@ body.overlay-autofit {
overflow: hidden; overflow: hidden;
width: 100%; width: 100%;
height: 100%; height: 100%;
visibility: hidden;
}
.overlay-loaded #overlay-element {
visibility: visible;
} }
/** /**

View File

@ -283,19 +283,17 @@ Drupal.overlay.load = function (url) {
// Change the overlay title. // Change the overlay title.
self.$container.dialog('option', 'title', Drupal.t('Loading...')); self.$container.dialog('option', 'title', Drupal.t('Loading...'));
// When a new overlay is opened and loaded, we add a loaded class to the // While the overlay is loading, we remove the loaded class from the dialog.
// dialog. The loaded class is not removed and added back again while // After the loading is finished, the loaded class is added back. The loaded
// switching between pages with the overlay already open, due to // class is being used to hide the iframe while loading.
// performance issues (see http://drupal.org/node/615130). // @see overlay-parent.css .overlay-loaded #overlay-element
self.$dialog.removeClass('overlay-loaded'); self.$dialog.removeClass('overlay-loaded');
self.$iframe self.$iframe
.css('visibility', 'hidden')
.bind('load.overlay-event', function () { .bind('load.overlay-event', function () {
self.isLoading = false; self.isLoading = false;
// Only continue when overlay is still open and not closing. // Only continue when overlay is still open and not closing.
if (self.isOpen && !self.isClosing) { if (self.isOpen && !self.isClosing) {
self.$iframe.css('visibility', '');
self.$dialog.addClass('overlay-loaded'); self.$dialog.addClass('overlay-loaded');
} }
else { else {