-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Modal should inject .modal-content instead of .modal-body #9318
Comments
+1 |
Technically a duplicate of #5161, but to the extent that the |
Sry about that. Reading through the previous issues I see that this one will probably be closed as well. But can you at least give an explanation why? And tell us the workaround you have in mind? Maybe it's not needed, but I don't see any other simple way... |
This is broken now.... The remote url got loaded into the modal div directly, not in the modal-content BTW: |
+1 on @gabel's comment. For a while, I've wanted to be able to customize the header and footer on load, but I've discovered (as he says) it really duplicates a lot of HTML and makes my partial bound too strongly to the modal structure instead of being something that can be injected anywhere ( Plus, beyond those semantics, he's also right about it being broken as-is. It should insert into .modal-content if it is going to remain as is. In general, I know you guys aren't fond of cluttering up the |
It breaks old code. Such is the very nature of backwards-incompatible releases, like BS v3.
v3 breaks an absolute crap-ton of things already.
If you look at the issues related to this one, you'll see that lots of people want the new behavior and would prefer not to have to write any custom JS. Since one of Bootstrap's main fanbases is backend devs who want to quickly slap a spiffy frontend on something, this desire seems reasonable in context. And, in general, the modal title being based on server-side data is also a fairly common case.
This complaint seems entirely legit; I'd suggest opening a new issue about it. |
I still would like to know if there is a good clean work around for this problem? For now I will override the modal function so that it will put the content into the modal-body but I would like to have a clean solution for this. Any tips or idea's about this would be greatly appreciated. |
@dreagle Overriding is fairly clean. (But are you HTML-escaping the presumably-plain-text logs?) Or just don't use data-remote at all; do the fetch + injection/templating yourself (see above comment). |
I found the solution easier by taking the modal file from version 2.3.2 and use this one for only the modal calls. |
Instead of hardcoding to replace body, or content, etc., have it replace the inner of whatever is selected with data-target? |
I think that the modal plugin would benefit from the following enhancement:
when the
remote
option is specified (either using JS ordata-remote
attribute), the content should be loaded into .modal-content instead of .modal-body .This would allow folks to customize the modal-header (including title) and footer as well and allow more flexibility and reuse of code...
What do you think?
The text was updated successfully, but these errors were encountered: