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 @@
}
display(name) {
name = name || this.currentRouteName;
display(routeName = this.currentRouteName, resource) {
this.dispatchEvent(new CustomEvent('navigate', {detail: {route: routeName, resource}}));
for(let route of this.routes)
if(name == route.name)
if(routeName == route.name)
route.activate();
else
route.hide();
......@@ -127,8 +127,7 @@ route.getPath(this.prefix, routeName, id);
window.location.hash = path;
else
history.pushState({}, routeName, '/' + path);
this.dispatchEvent(new CustomEvent('navigate', {detail: {route: routeName, resource: resource}}));
this.display(routeName);
this.display(routeName, resource);
}
}
......
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