Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Update animated-background.js
Browse files Browse the repository at this point in the history
Hackfix for 2023.4.0
  • Loading branch information
dreimer1986 authored Apr 6, 2023
1 parent cbacf95 commit a0bc82d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions dist/animated-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ var Panel_Holder;
var Hui;
var Lovelace;
var Animated_Config;
var View_Layout;
var Haobj = null;
var View;
var Debug_Mode = false;
Expand Down Expand Up @@ -56,7 +55,7 @@ function getVars() {
Root = Root && Root.shadowRoot;
Root = Root && Root.querySelector("home-assistant-main");
Root = Root && Root.shadowRoot;
Root = Root && Root.querySelector("app-drawer-layout partial-panel-resolver");
Root = Root && Root.querySelector("app-drawer-layout partial-panel-resolver, ha-drawer partial-panel-resolver");
Root = (Root && Root.shadowRoot) || Root;
Root = Root && Root.querySelector("ha-panel-lovelace");
if (Root) {
Expand All @@ -70,7 +69,6 @@ function getVars() {
if (Lovelace) {
Animated_Config = Lovelace.config.animated_background;
}
View_Layout = Root.shadowRoot.getElementById("layout");
View = Root.shadowRoot.getElementById("view");
}
}
Expand Down Expand Up @@ -535,15 +533,13 @@ function removeDefaultBackground(node, current_config) {
if (current_config.background) {
background = current_config.background;
}
if (node.style.background != background || View_Layout.style.background != 'transparent') {
if (node.style.background != background) {
node.style.background = background;
View_Layout.style.background = 'transparent';
}
}

//restores lovelace theme background
function restoreDefaultBackground(node) {
View_Layout.style.background = null;
node.style.background = null;
}

Expand Down

0 comments on commit a0bc82d

Please sign in to comment.