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:
Alexander Skvortsov 2020-10-05 16:25:23 -04:00
parent 97c36f2f7d
commit df9be1b063

View File

@ -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) {