...
 
Commits (2)
......@@ -38,13 +38,13 @@ export default class SIBRouter extends HTMLElement {
return this.querySelectorAll('sib-route');
}
display(routeName = this.currentRouteName, resource, keepURL=false) {
display(routeName = this.currentRouteName, keepURL=false) {
for (let route of this.routes) {
if (routeName === route.name) {
route.activate(keepURL);
this.dispatchEvent(
new CustomEvent('navigate', {
detail: { route: routeName, resource },
detail: { route: routeName, resource: {id: route.resourceId} },
}),
);
} else {
......@@ -82,7 +82,7 @@ export default class SIBRouter extends HTMLElement {
const prefix = this.useHash ? '#' : '/';
history.pushState({}, routeName, prefix + path);
}
this.display(routeName, resource, keepURL);
this.display(routeName, keepURL);
}
}
customElements.define('sib-router', SIBRouter);
......