-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Allow for custom-sized modal windows #3429
Comments
Couldn't one use the |
Here is a demo using the windowClass property to achieve this. |
|
One should be able to use that top level class to do any CSS overrides of the inner class |
It's rather inconvenient to have to override other CSS properties, though. |
I think in this case, it is more desirable than adding an additional watch expression & add complexity to the modal API for something that can be solved with the existing API and pure CSS. |
Unless I don't understand how watch expressions work, it doesn't seem like it's adding an additional watch expression the way I suggested. Currently, it has to check the |
Ah, I see now. I think I can actually get behind this then - sorry, I misunderstood what you were suggesting as the implementation. Would you like to file a PR with this implementation and the appropriate documentation change? |
I'll have to look up how to do that (first time), but sure. |
We might be better of changing it to a function call, I believe that would remove the watch altogether. |
@RobJacobs , while I like less watchers, I think, for this particular case, it's better to keep it as a watcher since it's less likely that there'll be so many modals that the number of watchers per modal matters. Also, it's more readable to keep classes at the template. We can refactor this later for performance if needed. |
The suggestion does make sense. After all, in theory a modal's size shouldn't change once it's been created. |
Thank you @RevanProdigalKnight for this suggestion, it was really useful. |
Currently, a modal window's size classes are restricted to Bootstrap's built-in window classes of
.modal-sm
or.modal-lg
, but if a user adds a custom modal size class (e.g..modal-xl
or.modal-xs
), they cannot use it in$modal.open()
.Looking at the templates (
template/modal/window.html
), this could be simply modified from the existingto instead be
or something of that nature.
The text was updated successfully, but these errors were encountered: