mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 06:50:36 +08:00
Ensure that readyCallback is called on modals opened from other modals
This commit is contained in:
parent
b7593bc6a8
commit
be8fe44f0b
|
@ -28,6 +28,13 @@ export default class ModalManager extends Component {
|
|||
animateShow(readyCallback) {
|
||||
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.$()
|
||||
.one('shown.bs.modal', readyCallback)
|
||||
.modal({
|
||||
|
|
Loading…
Reference in New Issue
Block a user