mirror of
https://github.com/flarum/framework.git
synced 2025-03-10 04:05:30 +08:00
Ensure that readyCallback is called on modals opened from other modals
This commit is contained in:
parent
822ace668a
commit
5127e7d063
@ -28,6 +28,13 @@ export default class ModalManager extends Component {
|
|||||||
animateShow(readyCallback) {
|
animateShow(readyCallback) {
|
||||||
const dismissible = !!this.attrs.state.modal.componentClass.isDismissible;
|
const dismissible = !!this.attrs.state.modal.componentClass.isDismissible;
|
||||||
|
|
||||||
|
// If we are opening this modal while another modal is already open,
|
||||||
|
// the shown event will not run, because the modal is already open.
|
||||||
|
// So, we need to manually trigger the readyCallback.
|
||||||
|
if (this.$().hasClass('in')) {
|
||||||
|
readyCallback();
|
||||||
|
}
|
||||||
|
|
||||||
this.$()
|
this.$()
|
||||||
.one('shown.bs.modal', readyCallback)
|
.one('shown.bs.modal', readyCallback)
|
||||||
.modal({
|
.modal({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user