diff --git a/js/src/common/components/Modal.js b/js/src/common/components/Modal.js index b554b255e..0d621060a 100644 --- a/js/src/common/components/Modal.js +++ b/js/src/common/components/Modal.js @@ -24,7 +24,16 @@ export default class Modal extends Component { oncreate(vnode) { super.oncreate(vnode); - this.attrs.onshow(() => this.onready()); + this.attrs.animateShow(() => this.onready()); + } + + 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 (!this.attrs.state.modal) { + this.attrs.animateHide(); + } } view() { @@ -103,7 +112,7 @@ export default class Modal extends Component { * Hide the modal. */ hide() { - this.attrs.onhide(); + this.attrs.state.close(); } /** diff --git a/js/src/common/components/ModalManager.js b/js/src/common/components/ModalManager.js index 8d13fe434..9d0609c18 100644 --- a/js/src/common/components/ModalManager.js +++ b/js/src/common/components/ModalManager.js @@ -11,17 +11,18 @@ export default class ModalManager extends Component { return (