mirror of
https://github.com/flarum/core.git
synced 2025-07-28 20:20:34 +02:00
Move drawer hide and modal close into onNewRoute
Let's stay consistent with previous behavior, and run these on "internal route change" (same component handles different route) as well as on initial render of a page component.
This commit is contained in:
@@ -12,9 +12,6 @@ export default class Page extends Component {
|
|||||||
|
|
||||||
this.onNewRoute();
|
this.onNewRoute();
|
||||||
|
|
||||||
app.drawer.hide();
|
|
||||||
app.modal.close();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class name to apply to the body while the route is active.
|
* A class name to apply to the body while the route is active.
|
||||||
*
|
*
|
||||||
@@ -32,6 +29,9 @@ export default class Page extends Component {
|
|||||||
onNewRoute() {
|
onNewRoute() {
|
||||||
app.previous = app.current;
|
app.previous = app.current;
|
||||||
app.current = new PageState(this.constructor, { routeName: this.attrs.routeName });
|
app.current = new PageState(this.constructor, { routeName: this.attrs.routeName });
|
||||||
|
|
||||||
|
app.drawer.hide();
|
||||||
|
app.modal.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
oncreate(vnode) {
|
oncreate(vnode) {
|
||||||
|
Reference in New Issue
Block a user