1
0
mirror of https://github.com/flarum/core.git synced 2025-07-20 00:01:17 +02:00

Prevent hide animation when opening modal from other modal

This commit is contained in:
Alexander Skvortsov
2020-09-25 12:54:03 -04:00
parent b4f563c38f
commit 822ace668a

View File

@@ -27,9 +27,14 @@ export default class Modal extends Component {
this.attrs.onshow(() => this.onready()); this.attrs.onshow(() => this.onready());
} }
onremove() { onbeforeremove() {
// If the global modal state currently contains a modal,
// we've just opened up a new one, and accordingly,
// we don't need to show a hide animation.
if (!app.modal.modal) {
this.attrs.onhide(); this.attrs.onhide();
} }
}
view() { view() {
if (this.alertAttrs) { if (this.alertAttrs) {
@@ -107,7 +112,7 @@ export default class Modal extends Component {
* Hide the modal. * Hide the modal.
*/ */
hide() { hide() {
this.attrs.onhide(); app.modal.close();
} }
/** /**