From bc60e9b857f4e354aa7d1c4231156e5e4fbb8e53 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 9 Nov 2021 18:46:38 +0100 Subject: [PATCH] header.js en cours --- core/module/theme/view/header/header.js.php | 28 +++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/core/module/theme/view/header/header.js.php b/core/module/theme/view/header/header.js.php index c8f5991f..d64405db 100644 --- a/core/module/theme/view/header/header.js.php +++ b/core/module/theme/view/header/header.js.php @@ -65,20 +65,22 @@ $("input, select").on("change", function() { var css = "@import url('https://fonts.googleapis.com/css?family=" + headerFont + "');"; // Couleurs, image, alignement et hauteur de la bannière - css += "header{background-color:" + $("#themeHeaderBackgroundColor").val() + ";text-align:" + $("#themeHeaderTextAlign").val() + ";"; - - if ($("#themeHeaderImage").val()) { - // Une image est sélectionnée - css += "background-image:url('site/file/source/" + $("#themeHeaderImage").val() + "');background-repeat:" + $("#themeHeaderImageRepeat").val() + ";background-position:" + $("#themeHeaderImagePosition").val() + ";"; - css += "background-size:" + $("#themeHeaderImageContainer").val() + ";"; - // Pas d'image sélectionnée - } else { - // Désactiver l'option responsive - css += "background-image:none;"; + if ($("#themeHeaderFeature") === "wallpaper") { + css += "header{background-color:" + $("#themeHeaderBackgroundColor").val() + ";text-align:" + $("#themeHeaderTextAlign").val() + ";"; + if ($("#themeHeaderImage").val()) { + // Une image est sélectionnée + css += "background-image:url('site/file/source/" + $("#themeHeaderImage").val() + "');background-repeat:" + $("#themeHeaderImageRepeat").val() + ";background-position:" + $("#themeHeaderImagePosition").val() + ";"; + css += "background-size:" + $("#themeHeaderImageContainer").val() + ";"; + // Pas d'image sélectionnée + } else { + // Désactiver l'option responsive + css += "background-image:none;"; + } + css += "line-height:" + $("#themeHeaderHeight").val() + ";height:" + $("#themeHeaderHeight").val() + "}"; + } + if ($("#themeHeaderFeature") === "feature") { + css += "header{height:" + $("#themeHeaderHeight").val() + ";}"; } - - css += "line-height:" + $("#themeHeaderHeight").val() + ";height:" + $("#themeHeaderHeight").val() + "}"; - // Taille, couleur, épaisseur et capitalisation du titre de la bannière css += "header span{color:" + $("#themeHeaderTextColor").val() + ";font-family:'" + headerFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeHeaderFontWeight").val() + ";font-size:" + $("#themeHeaderFontSize").val() + ";text-transform:" + $("#themeHeaderTextTransform").val() + "}";