Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay not closing per mask if once prevented #923

Open
double-uu opened this issue Jan 6, 2013 · 3 comments
Open

Overlay not closing per mask if once prevented #923

double-uu opened this issue Jan 6, 2013 · 3 comments

Comments

@double-uu
Copy link

Preconditions:
An overlay is opened and some second process/thread is started. While the thread is running closing the overlay is prevented by calling preventDefault() in the onBeforeClose event.

Action:
During runtime of the thread the event is fired by clicking the expose mask (one or more times).

Bug:
Now closing the overlay by clicking the expose mask is not working anymore and the onBeforeClose event is not fired anymore. The behaviour persists while the overlay remains open. Closing the overlay by the x button is still working.

Example:

var allowClose = false;

$("a[rel]").overlay({

    mask: {
        color: '#000000',
        loadSpeed: 200,
        opacity: 0.9
    },

    onBeforeLoad: function() {

        window.setTimeout(function() {

            allowClose = true;
        }, 3000);
    },

    onBeforeClose: function(e) {

        if(!allowClose)
        {
            e.preventDefault();
        }
        else
        {
            allowClose = false;
        }
    },

    left: "center",

    top: "center"

});
@alibby251
Copy link
Contributor

Hi double-uu,

Any chance you could please put the above example into a JSFiddle, so we can see this issue in action?

@double-uu
Copy link
Author

Yes, of course:
http://jsfiddle.net/Atvba/1/

@double-uu
Copy link
Author

Hi alibby,
could you reproduce it? Any ideas?
Thx
W

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants