mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 23:36:36 +00:00
Fix hassio panel nav on <0.90 HA
This commit is contained in:
parent
1d1c981601
commit
03dffa9905
@ -10,6 +10,7 @@ import "./hassio-pages-with-tabs";
|
|||||||
import applyThemesOnElement from "../../src/common/dom/apply_themes_on_element";
|
import applyThemesOnElement from "../../src/common/dom/apply_themes_on_element";
|
||||||
import EventsMixin from "../../src/mixins/events-mixin";
|
import EventsMixin from "../../src/mixins/events-mixin";
|
||||||
import NavigateMixin from "../../src/mixins/navigate-mixin";
|
import NavigateMixin from "../../src/mixins/navigate-mixin";
|
||||||
|
import { fireEvent } from "../../src/common/dom/fire_event";
|
||||||
|
|
||||||
class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) {
|
class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) {
|
||||||
static get template() {
|
static get template() {
|
||||||
@ -90,6 +91,15 @@ class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) {
|
|||||||
this.hass.dockedSidebar ? "hass-close-menu" : "hass-open-menu"
|
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() {
|
connectedCallback() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user