- 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;
width: 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.
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 {