From 7cd504974a4056a6a64b5742658a59601ac18db5 Mon Sep 17 00:00:00 2001 From: Rafael Tavares Juliani Date: Sat, 21 Oct 2023 04:35:09 -0300 Subject: [PATCH] If no divPageNavigation --- leitor-web.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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];