Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
aurelienlhx wants to merge 3 commits into kylefox:master from aurelienlhx:master

Conversation

@aurelienlhx
Copy link

@aurelienlhx aurelienlhx commented Aug 23, 2016
edited
Loading

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.

Display the modal calling $.modal('some content'}) without bind an html element. Useful for open a modal on an ajax response for exemple.
Copy link
Owner

kylefox commented Aug 24, 2016

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!

Copy link
Author

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.

Copy link
Owner

kylefox commented Aug 24, 2016

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 👍

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /