Skip to content

Commit

Permalink
View_Layout null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Villhellm committed Jul 7, 2020
1 parent 35a1700 commit 7a40147
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dist/animated-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ function getEntityState(entity) {

//main render function
function renderBackgroundHTML() {
if(!View_Layout){
return;
}
var current_config = currentConfig();
var state_url = "";
var temp_enabled = true;
Expand Down Expand Up @@ -527,6 +530,9 @@ function urlIsVideo(url) {

//removes lovelace theme background
function removeDefaultBackground(node, current_config) {
if(!View_Layout){
return;
}
var background = 'transparent';
if (current_config.background) {
background = current_config.background;
Expand All @@ -539,6 +545,9 @@ function removeDefaultBackground(node, current_config) {

//restores lovelace theme background
function restoreDefaultBackground(node) {
if(!View_Layout){
return;
}
View_Layout.style.background = null;
node.style.background = null;
}
Expand Down

0 comments on commit 7a40147

Please sign in to comment.