Skip to content

Commit 92b001d

Browse files
authored
Update animated-background.js
Adding fix listed in Villhellm#56
1 parent cbacf95 commit 92b001d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

dist/animated-background.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var Panel_Holder;
88
var Hui;
99
var Lovelace;
1010
var Animated_Config;
11-
var View_Layout;
1211
var Haobj = null;
1312
var View;
1413
var Debug_Mode = false;
@@ -56,7 +55,7 @@ function getVars() {
5655
Root = Root && Root.shadowRoot;
5756
Root = Root && Root.querySelector("home-assistant-main");
5857
Root = Root && Root.shadowRoot;
59-
Root = Root && Root.querySelector("app-drawer-layout partial-panel-resolver");
58+
Root = Root && Root.querySelector("app-drawer-layout partial-panel-resolver, ha-drawer partial-panel-resolver");
6059
Root = (Root && Root.shadowRoot) || Root;
6160
Root = Root && Root.querySelector("ha-panel-lovelace");
6261
if (Root) {
@@ -70,7 +69,6 @@ function getVars() {
7069
if (Lovelace) {
7170
Animated_Config = Lovelace.config.animated_background;
7271
}
73-
View_Layout = Root.shadowRoot.getElementById("layout");
7472
View = Root.shadowRoot.getElementById("view");
7573
}
7674
}
@@ -535,15 +533,13 @@ function removeDefaultBackground(node, current_config) {
535533
if (current_config.background) {
536534
background = current_config.background;
537535
}
538-
if (node.style.background != background || View_Layout.style.background != 'transparent') {
536+
if (node.style.background != background) {
539537
node.style.background = background;
540-
View_Layout.style.background = 'transparent';
541538
}
542539
}
543540

544541
//restores lovelace theme background
545542
function restoreDefaultBackground(node) {
546-
View_Layout.style.background = null;
547543
node.style.background = null;
548544
}
549545

0 commit comments

Comments
 (0)