For background, see #615130: Overlay locks up the browser and consumes 100% of CPU for certain browsers/graphics cards/operating systems, especially comments #36-#49 or thereabouts.

The spinning icon (modules/overlay/images/loading.gif) that previously showed when the overlay was starting up is still in the CVS repository, but was removed from actually displaying in the overlay module because the way it was displayed was causing massive performance problems.

This is a followup issue for adding it back, but in a way that does not kill performance. There may be a useful patch in the above issue to start with.... if so, it would be great to copy it here.

CommentFileSizeAuthor
#2 loading.patch1.13 KBKiphaas7
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xmacinfo’s picture

Here is my original comment on how to add back the throbber:

To fix this we need to dynamically add a class to the overlay container when the iframe is loaded.

From
<div id="overlay-container" class="ui-dialog-content ui-widget-content" [...]>

To
<div id="overlay-container" class="ui-dialog-content ui-widget-content loaded" [...]>

Once the "loaded" class is added in the "overlay-container", we could then override the loading image properly through CSS.

.overlay #overlay-container.loaded {background-image: none;}

I guess we need a jQuery pro here to add the "loaded" class when the page have finished loading.

We could then reapply the original loading line. ;-)

Kiphaas7’s picture

FileSize
1.13 KB

Slight variation on the way xmacinfo describes it, but not that much :).

Kiphaas7’s picture

Status: Active » Needs review
xmacinfo’s picture

Great! I'll test it with the same environment I used to test out the old "loading" image performance. :-)

xmacinfo’s picture

Status: Needs review » Reviewed & tested by the community

@Kiphaas7: Thank you. Now we can have back the "loading" image and not cause performance issue by letting it run in the background.

I tried this patch and commented the

.overlay-loaded #overlay-container {

line and my CPU jumped to 50% usage with Firefox. And using this patch as is, the CPU spiked at loading page and resumed at 5%. Which is expected on my old computer. I also checked for the loading image with Firebug to see if the image was still active, which is not.

This patch properly disable the "loading" image when the iframe is loaded. So I mark this as RTBC.

Please note that other performance issues with the overlay must have their own issues.

ksenzee’s picture

+1 to both the patch and the approach. When I tested it, I got the same results as xmacinfo. I think this is ready to go back in.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Great work! Committed to HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.