diff --git a/src/sib-router.js b/src/sib-router.js index 251c64153d309d8889851cbb1307a0877783746d..68bb5f6cc664c9e6e9724f7f0fa3f858430ffdd1 100644 --- a/src/sib-router.js +++ b/src/sib-router.js @@ -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);