-
Notifications
You must be signed in to change notification settings - Fork 177
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
few open modals #235
Comments
All I can say is that perhaps you expect the script to behave exactly like jQuery, so I would suggest using this instead: var firstModal = new Modal(document.getElementById('first-modal'));
var secondModal = new Modal(document.getElementById('second-modal'));
firstModal.show();
setTimeout(function() {
secondModal.show();
}, 3000); |
@thednp use a variable or not, it does not matter. |
Yeah. I don't understand why this has to happen after 3s, I also don't know why At this point this is the solution for you: close the current opened modal before initializing the second. The code looks like this now: var firstModal = new Modal(document.getElementById('first-modal'));
var secondModal = new Modal(document.getElementById('second-modal'));
firstModal.show();
setTimeout(function() {
firstModal.hide();
secondModal.show();
}, 3000); ... and solves the issue with |
You gave me an issue with an example, I gave you a solution, it's case closed for me. In most cases you need to learn and adapt to the code. |
@thednp
please open example. |
@epexa Why you want to open a modal within a modal? I think this is not a good user experience anyway |
Hey @epexa Please check the first demo, you can open a modal from inside another modal, this is what you might not know it to be possible. It basically allows you to create a "setup wizard" like functionality, just with the current code. For your issue, we're talking about a very specific use case here that can only be worked around easily just by following the script behavior. We don't want to change the scripting to accommodate just this use case. We also don't have the "modal on top of another modal" functionality/demo/example with the original jQuery plugin, so why bother? I coded something that is simple, effective, cross-browser supported, able to do a couple of things:
For 99% of us, this is more than enough, we don't need to change the code for one use case, your case. I can imagine what kind of hacks would be required for this functionality to work. We're 100% not interested in implementing such change, so if you ONLY cannot work your issue with the current code, feel free to fork it and make it your way, it's perfectly acceptable for anyone. |
if the window is already open, the second one can not be opened.
code:
error:
gist
live example
in Bootstrap.js (not native, with jQuery) all ok!
gist
live example
The text was updated successfully, but these errors were encountered: