diff --git a/js/src/common/components/ModalManager.js b/js/src/common/components/ModalManager.js index 7b77c504b..6624e38a1 100644 --- a/js/src/common/components/ModalManager.js +++ b/js/src/common/components/ModalManager.js @@ -6,12 +6,12 @@ import Component from '../Component'; * overwrite the previous one. */ export default class ModalManager extends Component { - init() { - this.state = this.props.state; + oninit(vnode) { + this.state = vnode.attrs.state; } - view() { - const modal = this.state.modal; + view(vnode) { + const modal = vnode.attrs.state.modal; return (
@@ -20,13 +20,8 @@ export default class ModalManager extends Component { ); } - config(isInitialized, context) { - if (isInitialized) return; - - // Since this component is 'above' the content of the page (that is, it is a - // part of the global UI that persists between routes), we will flag the DOM - // to be retained across route changes. - context.retain = true; + oncreate(vnode) { + super.oncreate(vnode); // Ensure the modal state is notified about a closed modal, even when the // DOM-based Bootstrap JavaScript code triggered the closing of the modal,