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

Verify Closing of Modal #180

Closed
sgsweb opened this Issue May 29, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@sgsweb

sgsweb commented May 29, 2012

When the user closes the modal using escape key, clicking outside the modal, or clicking the X, I like to popup another modal to ask them if they are sure. Similar to a confirm javascript api. The problem is that there is no way to prevent a closing using the beforeClose callback. That is, I cannot send back a false from the beforeClose callback to prevent the closing of the modal. What is the best method for doing this?

sgs.

@nyroDev

This comment has been minimized.

Show comment
Hide comment
@nyroDev

nyroDev Oct 16, 2014

Owner

See commits d42cd1f and 6fc3232

You'll be able to do something like:

$.nmFilters({
    custom: {
        close: function(nm) {
            if (!nm._confirmClosed) {
                if (confirm('Are you sure you want to close it?')) {
                    nm._confirmClosed = true;
                    nm.close();
                }
                return false;
            }
        }
    }
});
Owner

nyroDev commented Oct 16, 2014

See commits d42cd1f and 6fc3232

You'll be able to do something like:

$.nmFilters({
    custom: {
        close: function(nm) {
            if (!nm._confirmClosed) {
                if (confirm('Are you sure you want to close it?')) {
                    nm._confirmClosed = true;
                    nm.close();
                }
                return false;
            }
        }
    }
});

@nyroDev nyroDev closed this Oct 16, 2014

@nyroDev nyroDev added the tips label Oct 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment