You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

overlay with triggers of high z-index will not clear expose Created Oct 14, 2009

This thread is solved

Views: 2338     Replies: 7     Last reply Dec 28, 2009  
You must login first before you can use this feature

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

overlay with triggers of high z-index will not clear expose

Posted: Oct 14, 2009

Only 90% percent sure it's a bug with tools 1.1.2, 10% sure I profited from a bug in tools up to 1.1.1 ;-)

By giving a navi menu a higher index than overlay and expose I managed to be able to directly access triggers for a different overlay while an overlay was open. Working example with 1.1.1 here.

The problematic code boils down to something like this (the triggers would have z-index: 2000):


var olo = false;
$("a[rel]").overlay({
  expose: {zIndex: 500, color: "#333333"},
  zIndex: 1000,
  onBeforeLoad: function () {
    if (olo) {
      return false;
    }
    olo = true;
  },
  onBeforeClose: function () {
    olo = false;
  }
});

With tools 1.1.2 I can still load an overlay while another one is open, but then expose is not cleared once I close the overlay.

I've set up a small sample page that demonstrates the problem: Click on a trigger while an overlay is open, and then close the overlay, the expose color does not go away.

How can I achieve my desired behaviour with 1.1.2? Or is it a bug?

lbennett

Posts: 9

Registered:
Sep 16, 2009

my result different than yours

Posted: Oct 14, 2009

Reply to: overlay with triggers of high z-index will not clear expose, from blacktrash
I checked your sample, tested the various ways to close the overlay (ESC, click outside, or click the X), and in every case the grey overlay background did go away when I closed the overlays. Using MS Explorer 8 and FF 3.5.8.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» my result different than yours

Posted: Oct 14, 2009

Reply to: my result different than yours, from tr2@rogers.com
Open an overlay, don't close it, click on the other trigger which opens the other overlay (while the first closes), and then close the second one: the page is grey (the expose color) instead of white.

lbennett

Posts: 9

Registered:
Sep 16, 2009

» » my result different than yours

Posted: Oct 15, 2009

Reply to: » my result different than yours, from blacktrash
I did go back and forth between the two triggers and my result was as reported. There was one time when the grey background still showed and a second click cleared that.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» » » my result different than yours

Posted: Oct 15, 2009

Reply to: » » my result different than yours, from tr2@rogers.com
Right. With 1.1.1 you don't need that extra click to clear expose.

What I'd like to know is whether the 1.1.1 behaviour is intended or buggy, or the 1.1.2 behaviour. If the 1.1.2 behaviour stays, I'll I either have to stick with 1.1.1 for my client's page or find a workaround if I can.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» overlay with triggers of high z-index will not clear expose

Posted: Oct 23, 2009

Reply to: overlay with triggers of high z-index will not clear expose, from blacktrash
ping!

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» overlay with triggers of high z-index will not clear expose

Posted: Dec 12, 2009

Reply to: overlay with triggers of high z-index will not clear expose, from blacktrash
The problem is the switch from tools.expose-1.0.4 to tools.expose-1.0.5 and the undoubtedly more elegant event handling that it entails - in theory, in practice it breaks the above use case.

Somehow e.isDefaultPrevented() does not fire (the same way?) as the more clumsy


// possibility to cancel click action
var p = {proceed: true};
$(self).trigger("onBeforeLoad", p);				
if (!p.proceed) { return self; }

in 1.0.4 does.

Christian Ebert
Flowplayer support

Posts: 2803

Registered:
May 27, 2008

» overlay with triggers of high z-index will not clear expose

Posted: Dec 28, 2009

Reply to: overlay with triggers of high z-index will not clear expose, from blacktrash
Continuing my monologue ;-) But I seem to have found a solution that works with 1.1.2 and is probably cleaner (using api-methods etc.) anyway:


var overlaysel = "a[rel]";

$(overlaysel).overlay({ 
  expose: {zIndex: 500, color: "#333333"}, 
  zIndex: 1000,
  oneInstance: false, 
  onBeforeLoad: function () {
    // close all open instances
    $(overlaysel).each(function () {
      var ol = $(this).overlay();
      if (ol.isOpened()) {
        ol.close();
      }
    }); 
  }
});

Solution: allow more than 1 overlay instance, only to potentially close them onBeforeLoad.