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

How to prevent jBox from closing? #215

Open
samcov opened this issue Mar 1, 2023 · 2 comments
Open

How to prevent jBox from closing? #215

samcov opened this issue Mar 1, 2023 · 2 comments

Comments

@samcov
Copy link

samcov commented Mar 1, 2023

How to I get jBox to NOT close if I check a condition and I want them to go back and fix.

There is a "onClose", where I can confirm, but returning false doesn't work, it closes anyway. I use the "onCloseComplete" to finalize everything.

What must I do to prevent closing in the "onClose" event?

@StephanWagner
Copy link
Owner

Maybe you could use the methods this.disable() and this.enable(), see here: https://stephanwagner.me/jBox/methods#disable-and-enable

When you use this.disable(), jBox won't close or open anymore. Once the condition is met, you could use this.enable(); this.close() to close the jBox.

If that doesn't work you could try using this.open() in onClose(), but that's very hacky.

@idistack
Copy link

idistack commented May 7, 2023

@samcov try this.isOpen = false;, for example

onClose: function() {
  this.isOpen = false;
  if (someCond) {
    this.isOpen = true;
  }
}

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

3 participants