Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

onClose callback #31

Closed
Jito opened this issue Feb 24, 2012 · 3 comments
Closed

onClose callback #31

Jito opened this issue Feb 24, 2012 · 3 comments

Comments

@Jito
Copy link

Jito commented Feb 24, 2012

It would be handy a callback function fired when the user exits the modal with the Esc key, without pressing any action button.

@nikku
Copy link
Owner

nikku commented Feb 25, 2012

There exist

$("dialog").bind("dialog2.closed", function(event) {
    alert("Dialog was closed");
});

Does that help?

@Jito
Copy link
Author

Jito commented Feb 25, 2012

And how could I do that if I'm using the helpers? I mean, in that scenario there's no object I'm attaching the bind method to.

@nikku
Copy link
Owner

nikku commented Jun 3, 2012

Sorry for the late response!

The call to $.fn.dialog2.helpers.alert("This dialog is non intrusive", { ... }") does return the dialog 2 dom element. You can freely bind your event listeners against it (e.g. var dialog = $.fn.dialog2.helpers.alert(...); dialog.bind("dialog2.closed", ...);.

@nikku nikku closed this as completed Jun 3, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants