diff --git a/leitor-web.js b/leitor-web.js index 0c81c79..62731cb 100644 --- a/leitor-web.js +++ b/leitor-web.js @@ -109,7 +109,7 @@ window.onload = (event) => { - if (luz_apagada && !modo_escuro) { + if (luz_apagada && !modo_escuro && divPageNavigation) { divPageNavigation.style.background = tipo_de_papel[obj[1]]; @@ -399,7 +399,7 @@ window.onload = (event) => { salvarOpcoesUsuario('papel', indiceTipoPapel); - if (luz_apagada){ + if (luz_apagada && divPageNavigation){ divPageNavigation.style.background = tipo_de_papel[indiceTipoPapel]; @@ -413,7 +413,12 @@ window.onload = (event) => { quartoContent.classList.remove('luz_apagada'); - divPageNavigation.style.removeProperty('background'); + if(divPageNavigation){ + + divPageNavigation.style.removeProperty('background'); + + } + sidebar.style.removeProperty('color') sidebar.classList.remove('luz_apagada'); @@ -445,7 +450,12 @@ window.onload = (event) => { quartoContent.classList.add('luz_apagada'); - divPageNavigation.style.backgroundColor = tipo_de_papel[indiceTipoPapel]; + if(divPageNavigation){ + + divPageNavigation.style.backgroundColor = tipo_de_papel[indiceTipoPapel]; + + } + papel.style.background = tipo_de_papel[indiceTipoPapel];