From 5238a190898f908c06f84c18d2eff3d82c24c2da Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 28 Apr 2023 21:24:58 +0200 Subject: [PATCH] Hide sidebar ha-icon-button --- wallpanel.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/wallpanel.js b/wallpanel.js index 701ce6b..6374b39 100644 --- a/wallpanel.js +++ b/wallpanel.js @@ -108,7 +108,7 @@ class ScreenWakeLock { } } -const version = "4.10.2"; +const version = "4.10.3"; const defaultConfig = { enabled: false, enabled_on_tabs: [], @@ -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) {