From 03dffa99050fdf18fae0082a2932a20e9deb5cdd Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 19 Mar 2019 10:10:26 -0700 Subject: [PATCH] Fix hassio panel nav on <0.90 HA --- hassio/src/hassio-main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hassio/src/hassio-main.js b/hassio/src/hassio-main.js index 84fbbc5383..a01086d6db 100644 --- a/hassio/src/hassio-main.js +++ b/hassio/src/hassio-main.js @@ -10,6 +10,7 @@ import "./hassio-pages-with-tabs"; import applyThemesOnElement from "../../src/common/dom/apply_themes_on_element"; import EventsMixin from "../../src/mixins/events-mixin"; import NavigateMixin from "../../src/mixins/navigate-mixin"; +import { fireEvent } from "../../src/common/dom/fire_event"; class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) { static get template() { @@ -90,6 +91,15 @@ class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) { this.hass.dockedSidebar ? "hass-close-menu" : "hass-open-menu" ); }); + // Paulus - March 19, 2019 + // We changed the navigate event to fire directly on the window, as that's + // where we are listening for it. However, the older panel_custom will + // listen on this element for navigation events, so we need to forward them. + window.addEventListener("location-changed", (ev) => + fireEvent(this, ev.type, ev.detail, { + bubbles: false, + }) + ); } connectedCallback() {