Commit 5be7c645 authored by Clément's avatar Clément

bugfix: navigate event is now triggered on first display

parent fcc6e6ff
...@@ -107,10 +107,10 @@ ...@@ -107,10 +107,10 @@
} }
display(name) { display(routeName = this.currentRouteName, resource) {
name = name || this.currentRouteName; this.dispatchEvent(new CustomEvent('navigate', {detail: {route: routeName, resource}}));
for(let route of this.routes) for(let route of this.routes)
if(name == route.name) if(routeName == route.name)
route.activate(); route.activate();
else else
route.hide(); route.hide();
...@@ -127,8 +127,7 @@ route.getPath(this.prefix, routeName, id); ...@@ -127,8 +127,7 @@ route.getPath(this.prefix, routeName, id);
window.location.hash = path; window.location.hash = path;
else else
history.pushState({}, routeName, '/' + path); history.pushState({}, routeName, '/' + path);
this.dispatchEvent(new CustomEvent('navigate', {detail: {route: routeName, resource: resource}})); this.display(routeName, resource);
this.display(routeName);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment