Skip to content

Commit

Permalink
Fix for new page layout in HA 2023.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gadgetchnnel committed Apr 6, 2023
1 parent 150e4ce commit 8b45d44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/lovelace-header-cards.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,25 @@ class HeaderCards {

get panel(){
let root = this.main && this.main.shadowRoot;
root = root && root.querySelector("app-drawer-layout partial-panel-resolver");
root = root && root.querySelector("ha-drawer partial-panel-resolver");
root = root && root.shadowRoot || root;
root = root && root.querySelector("ha-panel-lovelace");
return root;
}

get header() {
let header = this.main && this.main.shadowRoot;
header = header && header.querySelector("ha-panel-lovelace");
let header = this.panel;
header = header && header.shadowRoot;
header = header && header.querySelector("hui-root");
header = header && header.shadowRoot;
header = header && header.querySelector("app-header");
header = header && header.querySelector("div.header");

return header;
}

get toolbar() {
return this.header && this.header.querySelector("app-toolbar");
toolbar = this.header && this.header.querySelector("div.toolbar");
return toolbar;
}

get hass(){
Expand Down Expand Up @@ -159,7 +159,7 @@ class HeaderCards {

let tabs = this.toolbar && this.toolbar.querySelector("ha-tabs");
let mainTitle = this.toolbar && this.toolbar.querySelector("div[main-title]");
let button = this.toolbar && this.toolbar.querySelector("ha-icon-button, ha-button-menu");
let button = this.toolbar && this.toolbar.querySelector("div.action-items");

let oldHeaderCards = this.toolbar.querySelector("#headerCards");
if(oldHeaderCards) oldHeaderCards.remove();
Expand Down

0 comments on commit 8b45d44

Please sign in to comment.