-
Notifications
You must be signed in to change notification settings - Fork 660
Display modal without binding element #172
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
Conversation
Display the modal calling $.modal('some content'}) without bind an html element. Useful for open a modal on an ajax response for exemple.
Display modal without binding element
Thanks, but I'm not sure this API feels right. Why not use the manual method of opening modals from content like this?
$(someContent).modal();
You can also do ☝ inside an AJAX event handler.
I'm going to close this, but if I've overlooked something let me know and we can discuss further. Thanks!
Cause firstly, your exemple does not work with a simple text node (you have to wrap it) and secondly i think it is may be better in performance point of view with bigger content (eg: if i return a partial page to display in the modal, jquery do not have to recreate with $('very big content with a lot of html tag')).
Finally this appear to me cleaner and easier to understand as we are not dealing with an element from the html page.
It's my opinion.
Cool, thanks for the extra info. I appreciate what you've done but I'm not 100% sure it's a fit for the core library. But it's good to have this PR on record for people who might need this functionality 👍
Uh oh!
There was an error while loading. Please reload this page.
Display the modal calling $.modal('some content',{option:value}) without bind an html element. Useful for open a modal on an ajax response for exemple. Just 4 small lines to add.