Skip to content

Commit

Permalink
Hide sidebar ha-icon-button
Browse files Browse the repository at this point in the history
  • Loading branch information
j-a-n committed Apr 28, 2023
1 parent 863159d commit 5238a19
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion wallpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class ScreenWakeLock {
}
}

const version = "4.10.2";
const version = "4.10.3";
const defaultConfig = {
enabled: false,
enabled_on_tabs: [],
Expand Down Expand Up @@ -363,6 +363,23 @@ function getCurrentView() {


function setSidebarHidden(hidden) {
try {
const haIconButton = elHaMain.shadowRoot
.querySelector("ha-panel-lovelace").shadowRoot
.querySelector("hui-root").shadowRoot
.querySelector("div.toolbar")
.querySelector("ha-menu-button").shadowRoot
.querySelector("ha-icon-button");
if (hidden) {
haIconButton.style.display = "none";
}
else {
haIconButton.style.removeProperty("display");
}
}
catch (e) {
if (config.debug) console.debug(e);
}
try {
let sidebar = elHaMain.shadowRoot.querySelector("ha-sidebar");
if (sidebar) {
Expand Down

0 comments on commit 5238a19

Please sign in to comment.