From 1ee1aa7d9241e7289d44cf9c5a9332966472ea57 Mon Sep 17 00:00:00 2001 From: whatevercamps Date: Mon, 3 Feb 2020 19:42:31 -0500 Subject: [PATCH] =?UTF-8?q?Cambio=20en=20nombre=20de=20funci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/darkMode.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/darkMode.js b/js/darkMode.js index 5332312..2949f0b 100644 --- a/js/darkMode.js +++ b/js/darkMode.js @@ -1,4 +1,10 @@ -function darkMode() { if (document.body.style.backgroundColor == "black") { +/* +Nuevamente, te recomiendo revisar mejor cómo llamas las funciones +porque de resto está perfecto. +*/ + +function changeMainColor() { + if (document.body.style.backgroundColor == "black") { document.body.style.backgroundColor = "white"; document.body.style.color = "black"; if (location.pathname === "/en.html") { @@ -21,7 +27,7 @@ function darkMode() { if (document.body.style.backgroundColor == "black") { function listeners() { this.document .getElementById("cambioTema") - .addEventListener("click", darkMode); + .addEventListener("click", changeMainColor); } window.addEventListener("load", listeners, false);