From cdde2f99c2f5b5b19ae9aeccd59b0a7a6c6a39ff Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 2 Oct 2017 12:10:44 +0200 Subject: [PATCH] double cube holder by theme --- .../views/js/doublecube-thematique.js | 90 +++++++++++++++---- 1 file changed, 73 insertions(+), 17 deletions(-) diff --git a/www/modules/antadissimulator/views/js/doublecube-thematique.js b/www/modules/antadissimulator/views/js/doublecube-thematique.js index d43e481e..c51510de 100644 --- a/www/modules/antadissimulator/views/js/doublecube-thematique.js +++ b/www/modules/antadissimulator/views/js/doublecube-thematique.js @@ -30,24 +30,80 @@ function initFaces() $(".container-db .db-cube1 .back").addClass('face-custom-txt'); $(".container-db .db-cube1 .back").addClass('face-custom-img'); - $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); - $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); - // Doublecube holder - if (theme == "ivoire" || theme == "tendance" || theme == "champetre" || theme == "uv") { - $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube1 .left"); - } - if (theme == "enfantin" || theme == "dentellechic" || theme == "oriental") { - $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .front"); - } - if (theme == "liberty") { - $('#custom_elmts .date-holder-line').clone().appendTo(".container-db .db-cube2 .front"); - $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .top"); - } - if(theme == "chocolate" || theme == "cinema" || theme == "oriental" || theme == "fleurs" - || theme == "vintage" || theme == "voyage" || theme == "gourmandise") { - $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .right"); - } + switch(theme) { + case "ivoire": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube1 .left"); + break; + case "fleurs": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .right"); + break; + case "dentellechic": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .front"); + break; + case "enfantin": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .front"); + break; + case "liberty": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder-line').clone().appendTo(".container-db .db-cube2 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .top"); + break; + case "oriental": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .front"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .right"); + break; + case "uv": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube1 .left"); + break; + case "vintage": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .right"); + break; + case "voyage": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .right"); + break; + case "tendance": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube1 .left"); + break; + case "champetre": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube1 .left"); + break; + case "cinema": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .right"); + break; + case "chocolate": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .right"); + break; + case "gourmandise": + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube1 .front"); + $('#custom_elmts .noms-holder').clone().appendTo(".container-db .db-cube2 .bottom"); + $('#custom_elmts .date-holder').clone().appendTo(".container-db .db-cube2 .right"); + break; + } $('.container-db .db-cube1 .top').css({'background-image':'url('+themeImg+'/box/1-TOP.png)'}); $('.container-db .db-cube1 .bottom').css({'background-image':'url('+themeImg+'/box/1-BOTTOM.png)'});