mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 18:12:59 +08: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:
parent
97c36f2f7d
commit
df9be1b063
|
@ -12,9 +12,6 @@ export default class Page extends Component {
|
|||
|
||||
this.onNewRoute();
|
||||
|
||||
app.drawer.hide();
|
||||
app.modal.close();
|
||||
|
||||
/**
|
||||
* A class name to apply to the body while the route is active.
|
||||
*
|
||||
|
@ -32,6 +29,9 @@ export default class Page extends Component {
|
|||
onNewRoute() {
|
||||
app.previous = app.current;
|
||||
app.current = new PageState(this.constructor, { routeName: this.attrs.routeName });
|
||||
|
||||
app.drawer.hide();
|
||||
app.modal.close();
|
||||
}
|
||||
|
||||
oncreate(vnode) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user