diff --git a/framework/core/js/src/admin/AdminApplication.js b/framework/core/js/src/admin/AdminApplication.js index 03669d6e0..1e75a3c30 100644 --- a/framework/core/js/src/admin/AdminApplication.js +++ b/framework/core/js/src/admin/AdminApplication.js @@ -27,20 +27,19 @@ export default class AdminApplication extends Application { * @inheritdoc */ mount() { - m.mount(document.getElementById('app-navigation'), { view: () => Navigation.component({ className: 'App-backControl', drawer: true }) }); - m.mount(document.getElementById('header-navigation'), Navigation); - m.mount(document.getElementById('header-primary'), HeaderPrimary); - m.mount(document.getElementById('header-secondary'), HeaderSecondary); - m.mount(document.getElementById('admin-navigation'), AdminNav); - // Mithril does not render the home route on https://example.com/admin, so // we need to go to https://example.com/admin#/ explicitly. if (!document.location.hash) document.location.hash = '#/'; m.route.prefix = '#'; - super.mount(); + m.mount(document.getElementById('app-navigation'), { view: () => Navigation.component({ className: 'App-backControl', drawer: true }) }); + m.mount(document.getElementById('header-navigation'), Navigation); + m.mount(document.getElementById('header-primary'), HeaderPrimary); + m.mount(document.getElementById('header-secondary'), HeaderSecondary); + m.mount(document.getElementById('admin-navigation'), AdminNav); + // If an extension has just been enabled, then we will run its settings // callback. const enabled = localStorage.getItem('enabledExtension'); diff --git a/framework/core/js/src/forum/ForumApplication.js b/framework/core/js/src/forum/ForumApplication.js index fdac5ffa8..78f300a60 100644 --- a/framework/core/js/src/forum/ForumApplication.js +++ b/framework/core/js/src/forum/ForumApplication.js @@ -115,17 +115,19 @@ export default class ForumApplication extends Application { this.routes[defaultAction].path = '/'; this.history.push(defaultAction, this.translator.trans('core.forum.header.back_to_index_tooltip'), '/'); + this.pane = new Pane(document.getElementById('app')); + + m.route.prefix = ''; + super.mount(this.forum.attribute('basePath')); + + // We mount navigation and header components after the page, so components + // like the back button can access the updated state when rendering. m.mount(document.getElementById('app-navigation'), { view: () => Navigation.component({ className: 'App-backControl', drawer: true }) }); m.mount(document.getElementById('header-navigation'), Navigation); m.mount(document.getElementById('header-primary'), HeaderPrimary); m.mount(document.getElementById('header-secondary'), HeaderSecondary); m.mount(document.getElementById('composer'), { view: () => Composer.component({ state: this.composer }) }); - this.pane = new Pane(document.getElementById('app')); - - m.route.prefix = ''; - super.mount(this.forum.attribute('basePath')); - alertEmailConfirmation(this); // Route the home link back home when clicked. We do not want it to register