theme site bug option marges

This commit is contained in:
Fred Tempez 2021-11-09 13:29:20 +01:00
parent 2c613b7186
commit 3b74d630d2
1 changed files with 13 additions and 24 deletions

View File

@ -11,35 +11,23 @@
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
/*
* Chargement de l'aperçu
*/
$(document).ready(function() {
/**
* Option de marge si la taille n'est pas fluide
*/
if ($('#themeSiteWidth').val() === '100%') {
$("#themeSiteMargin").prop("checked", true);
$("#themeSiteMargin").addClass("disabled");
} else {
$("#themeSiteMargin").addClass("enabled");
}
// Charger l'aperçu initial
previewDOM();
});
/** /**
* Aperçu en direct * Aperçu en direct
*/ */
$("input, select").on("change",function() { $("input, select").on("change",function() {
previewDOM();
});
function previewDOM() { /**
* Option de marge si la taille n'est pas fluide
*/
if ($('#themeSiteWidth').val() === '100%') {
console.log ("pop");
$("#themeSiteMarginWrapper").prop("checked", true);
$("#themeSiteMarginWrapper").hide();
} else {
$("#themeSiteMarginWrapper").show();
}
/** /**
* Aperçu dans la boîte * Aperçu dans la boîte
@ -96,7 +84,6 @@ function previewDOM() {
// Couleur ou image de fond // Couleur ou image de fond
var backgroundImage = <?php echo json_encode(helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['theme','body','image'])); ?>; var backgroundImage = <?php echo json_encode(helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['theme','body','image'])); ?>;
console.log(backgroundImage);
var backgroundcolor = <?php echo json_encode($this->getdata(['theme','body','backgroundColor'])); ?>; var backgroundcolor = <?php echo json_encode($this->getdata(['theme','body','backgroundColor'])); ?>;
if(backgroundImage) { if(backgroundImage) {
css += "div.bodybackground{background-image:url(" + backgroundImage + ");background-repeat:" + $("#themeBodyImageRepeat").val() + ";background-position:" + $("#themeBodyImagePosition").val() + ";background-attachment:" + $("#themeBodyImageAttachment").val() + ";background-size:" + $("#themeBodyImageSize").val() + "}"; css += "div.bodybackground{background-image:url(" + backgroundImage + ");background-repeat:" + $("#themeBodyImageRepeat").val() + ";background-position:" + $("#themeBodyImagePosition").val() + ";background-attachment:" + $("#themeBodyImageAttachment").val() + ";background-size:" + $("#themeBodyImageSize").val() + "}";
@ -125,4 +112,6 @@ function previewDOM() {
.text(css) .text(css)
.appendTo("head"); .appendTo("head");
}; }).trigger("change");