From 13a3cfe3f18b51a957538a82ec7a722d206082d1 Mon Sep 17 00:00:00 2001 From: ksjdragon Date: Wed, 20 Apr 2016 23:16:21 -0400 Subject: [PATCH] fixed text color not updating --- atoms/index.css | 1 - atoms/js/onload.js | 4 +++- atoms/js/update.js | 13 ++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/atoms/index.css b/atoms/index.css index 2d8a4f8..8e97da1 100644 --- a/atoms/index.css +++ b/atoms/index.css @@ -3,7 +3,6 @@ /* Let's get this party started */ ::-webkit-scrollbar { width: 12px; - margin-ri } /* Track */ diff --git a/atoms/js/onload.js b/atoms/js/onload.js index 8d54cc7..90cd644 100644 --- a/atoms/js/onload.js +++ b/atoms/js/onload.js @@ -194,16 +194,18 @@ function makeSettings() { this.parentNode.style.opacity = "0"; setTimeout(function(){k.parentNode.style.display = "none";},300); // Text transition: opacity 0 + console.log("hi"); textDiv.parentNode.style.color = themeChart["font"][settings["theme"]].replace(")",",0)").replace("b","ba"); // Update settings through cookie deleteCookie(setting); document.cookie = setting+"="+choices[parseInt(this.className[0])][parseInt(this.className[1])]; - update(); // Text transition: opacity 1 setTimeout(function() { textDiv.nodeValue = value; textDiv.parentNode.style.color = themeChart["font"][settings["theme"]].replace(")",",1)").replace("b","ba"); + update(); }, 650) + } } } diff --git a/atoms/js/update.js b/atoms/js/update.js index 3a1e0d0..2855636 100644 --- a/atoms/js/update.js +++ b/atoms/js/update.js @@ -1,19 +1,22 @@ function changeTheme(type) { // Changes background image get("body").style.backgroundImage = "url('./resources/static/" + type +".png')"; - + get("body").style.color = themeChart["font"][type]; // Changes interface element colors for(var i = 0; i < get("pulltab").length; i++) { get("pulltab")[i].style.backgroundColor = themeChart["pulltab"][type]; - get("pulltab")[i].style.color = themeChart["font"][settings["theme"]].replace(")",",0)"); + get("pulltab")[i].style.color = themeChart["font"][type].replace(")",",0)"); get("pulltab")[i].onmouseover = function() { - this.style.color = themeChart["font"][settings["theme"]].replace(")",",1)").replace("b","ba"); + this.style.color = themeChart["font"][type].replace(")",",1)").replace("b","ba"); } get("pulltab")[i].onmouseleave = function() { - this.style.color = themeChart["font"][settings["theme"]].replace(")",",0)").replace("b","ba"); + this.style.color = themeChart["font"][type].replace(")",",0)").replace("b","ba"); } get("sidebar")[i].style.backgroundColor = themeChart["sidebar"][type]; - get("body").style.color = themeChart["font"][type]; + } + + for(var i = 0; i < get("selection").length; i++) { + get("selection")[i].style.color = themeChart["font"][type]; } }