Commit 8e983199 authored by Clément's avatar Clément

update: rename `navigation` event `requestNavigation`

parent 90efb47f
......@@ -74,7 +74,7 @@
constructor() {
super();
window.addEventListener('popstate', event => this.display());
window.addEventListener('navigate', event => this.navigate(event.detail.route, event.detail.resource));
window.addEventListener('requestNavigation', event => this.navigate(event.detail.route, event.detail.resource));
window.addEventListener('WebComponentsReady', event => this.display());
}
get useHash() {
......@@ -142,7 +142,13 @@
return this.getAttribute('next');
}
trigger() {
if(this.next) window.dispatchEvent(new CustomEvent('navigate', {detail: {route: this.next}}));
if (!this.next) return
this.dispatchEvent(
new CustomEvent('requestNavigation', {
bubbles: true,
detail: { route: this.next },
}),
);
}
}
......
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