LightFace icon indicating copy to clipboard operation
LightFace copied to clipboard

lightfaceOverlay doesnt go away..

Open strongwazz opened this issue 14 years ago • 7 comments
trafficstars

Heya,

First off, LOVE this library. It's fantastic. So I thank you for that!

I've recently updated to MooTools 1.4. Lightface appears to work flawlessly except for one little snag.

Once its loaded (using mostly the request and iframe extensions here) , the element with class="lightfaceOverlay" doesn't get all the same inline css as when using moo-tools 1.2.

visibility: hidden is not added.

Top:0, and opacity: 0; are added just not the visibility attribute.

I've gone back and tested with a fresh download of MooTools 1.3, and it works fine, just not with 1.4.

Ive had a hunt through the code, but cannot find any references to visibility, so I'm assuming its part of a MooTools event such as hide() or fade() which has changed within MooTools itself.

Are you able to help me with this, and even just point out what I need to do to get the visibility attribute back into the overlay once it's loaded.

Many Thanks!

strongwazz avatar Sep 28 '11 23:09 strongwazz

Don't know whats changed in 1.4, tried tracing it back through mootools core - got lost at sea.

Added this change to work around it.

https://github.com/khandieyea/LightFace/commit/0f567eb690115a013c9b1b46c22dd12ae53c7fc2

Cheers

strongwazz avatar Sep 29 '11 00:09 strongwazz

Hey khandieyea, thanks for your post, exactly got also in trouble with this issue. I also discovered so far that visibility:hidden is not added. If I find out what's wrong I'll get back here.

afoeder avatar Oct 14 '11 11:10 afoeder

I'm noticing this issue too. This makes the buttons unusable as well.

In regards to the patch that khandieyea created, I'm not sure that it correctly addresses the issue. Under MooTools 1.2 and 1.3 when not using overlayAll (overlayAll = false) the visibility of the lightfaceOverlay is hidden when it is created, even before the open() method is called. In 1.4x the visibility style isn't set at all.

You'll notice that the same is true for the lightface parent element as well. Under 1.4, visibility is not set when it is injected into the page, 1.2 and 1.3 have visibility set to hidden when it is created.

ericcholis avatar Dec 15 '11 16:12 ericcholis

I'm kind of live-commenting while I debug this.

Looks like the culprit comes down to the way 1.4 sets visibility when opacity is set. In 1.4, the following function is run when opacity is set: https://github.com/mootools/mootools-core/blob/master/Source/Element/Element.Style.js#L29

In 1.3, the following setter and getter are run when modifying opacity: https://github.com/mootools/mootools-core/blob/1.3x/Source/Element/Element.Style.js#L40

So, something isn't firing the setVisibility function under 1.4.

ericcholis avatar Dec 15 '11 16:12 ericcholis

I'm pretty sure I have a working (temporary) fix for this issue:

https://github.com/ericcholis/LightFace/commit/902b741309f78f3353080fa10607d4a9b2b703fb

In addition to khandieyea's changes, I added similar functionality to this.box and this.overlay to ensure that the visibility is set when the opacity changes.

ericcholis avatar Dec 15 '11 18:12 ericcholis

Small update to the above commit:

https://github.com/ericcholis/LightFace/commit/318a804851abe9bd68c43dd0d07b02edf78da0dc

this.overlay needs to have visibility when used with things like LightFace.Request, to show the loading animation.

ericcholis avatar Dec 15 '11 19:12 ericcholis

just mentioning #13 here, looks like these are duplicates of each other.

afoeder avatar Mar 19 '13 12:03 afoeder