correction affichage "both" dans le modal

master
adplantade 5 years ago
parent e6d4ea5698
commit 7836015a6d

@ -13,6 +13,12 @@ btn.onclick = function() {
document.getElementById("color_pickers").style.display= (displ!="points" ? "none" : "inline");
document.getElementById("gems_picker").style.display= (displ=="points" ? "none" : "inline");
document.getElementById(getCookie("displayMode")+"_di").classList.add(selectedTheme);
if(displ=="both")
{
applyBackgrounds();
backgroundBoth();
}
}
// When the user clicks on <span> (x), close the modal
@ -31,6 +37,12 @@ window.onclick = function(event) {
document.getElementById("displays").addEventListener("click", function(){
document.getElementById("color_pickers").style.display= (displ!="points" ? "none" : "inline");
document.getElementById("gems_picker").style.display= (displ=="points" ? "none" : "inline");
if(displ=="both")
{
applyBackgrounds();
backgroundBoth();
}
})
function saveOptions() {
@ -58,11 +70,11 @@ function selectDisplay(e)
document.getElementById("both_di").classList.remove(selectedTheme);
document.getElementById(e+"_di").classList.add(selectedTheme);
backgroundBoth();
dispDots();
if(displ=="both")
{
applyBackgrounds();
}
dispDots();
}
function backgroundBoth()
@ -179,13 +191,14 @@ function applyBackgrounds()
for(var cpt=1;cpt<9;cpt++)
{
var target = document.getElementById("slot"+cpt);
target.classList.add("dot");
target.style.backgroundColor=target.children[0].src.substring(target.children[0].src.search("/ress")+6);
console.log("cookie avant : "+getCookie("gem"+cpt));
//console.log("cookie avant : "+getCookie("gem"+cpt));
setCookie("gem"+cpt,target.style.backgroundColor,30);
console.log("cookie après : "+getCookie("gem"+cpt));
//console.log("cookie après : "+getCookie("gem"+cpt));
//console.log("trg : "+target.id+ "|"+target.children[0].src.substring(target.children[0].src.search("/ress")+6));
}
console.log("--------");
//console.log("--------");
}
var gemsAvailable=["green","yellow","cyan","red","purple","orange","brown","black"];
@ -194,7 +207,7 @@ var gemsSelected=[];
for(var cpt=0;cpt<8;cpt++)
{
gemsSelected[cpt]= (getCookie("gem"+(cpt+1))=="" ? gemsAvailable[cpt] : getCookie("gem"+(cpt+1)));
console.log("get : "+gemsSelected[cpt]);
//console.log("get : "+gemsSelected[cpt]);
}
for(var cpt=1;cpt<9;cpt++)

Loading…
Cancel
Save