[9.1.04] header responsive test continuing

This commit is contained in:
fredtempez 2019-05-11 23:31:37 +02:00
parent 5ca13a9b0d
commit 665b66f2bf
3 changed files with 21 additions and 17 deletions

View File

@ -1006,16 +1006,16 @@ class core extends common {
$css .= ';height: 0; padding-top:';
$css .= ( $sizes[1] / $sizes[0] )* 100;
$css .= '%';
} else {
//} else {
// Le fichier n'existe plus
// largeur par défaut
$css .= ';height: 150px;';
// $css .= ';height: 150px; line-height: 150px;';
}
} else {
// Valeur de hauteur traditionnelle
$css .= ';height:' . $this->getData(['theme', 'header', 'height']);
$css .= ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) ;
}
$css .= ';line-height:' . $this->getData(['theme', 'header', 'height']) . ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}';
$css .= ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}';
if($themeHeaderImage = $this->getData(['theme', 'header', 'image'])) {
$css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}';
}

View File

@ -23,16 +23,16 @@ $("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() + ";line-height:" + $("#themeHeaderHeight").val();
css += "header{background-color:" + $("#themeHeaderBackgroundColor").val() + ";text-align:" + $("#themeHeaderTextAlign").val() + ";";
// Hauteur proportionnelle
var themeHeaderHeight = $("#themeHeaderHeight").val();
var widthSize = $("#themeHeaderImageWidth").val();
var heightSize = $("#themeHeaderImageHeight").val();
if (themeHeaderHeight === "none" ) {
css += ";height: 0; padding-top:" + (heightSize / widthSize ) * 100 + "%;}";
css += "height: 0; padding-top:" + (heightSize / widthSize ) * 100 + "%}";
} else {
css += ";height:" + themeHeaderHeight + ";}";
css += ";line-height:" + $("#themeHeaderHeight").val() + ";height:" + themeHeaderHeight + "}";
}
var themeHeaderImage = $("#themeHeaderImage").val();
@ -47,7 +47,7 @@ $("input, select").on("change", function() {
css += "header{background-size:" + $("#themeHeaderImageContainer").val() + "}";
console.log(css);
console.log(widthSize + "-" + heightSize + ' ' + themeHeaderImage );
// Taille, couleur, épaisseur et capitalisation du titre de la bannière
@ -145,6 +145,7 @@ $("#themeHeaderImage").on("change", function() {
});
}
}).trigger("change");
// Affiche / Cache les options de la position
$("#themeHeaderPosition").on("change", function() {
if($(this).val() === 'site') {

View File

@ -40,16 +40,19 @@
<div class="block">
<h4>Image</h4>
<?php
$sizes = getimagesize('site/file/source/'.$this->getData(['theme','header','image']));
echo template::text('themeHeaderImageWidth', [
'value' => $sizes [0],
'noDirty' => true
]);
echo template::text('themeHeaderImageHeight', [
'value' => $sizes [1],
'noDirty' => true
]);
$imageFile = file_exists('site/file/source/'.$this->getData(['theme', 'header', 'image'])) ? $this->getData(['theme', 'header', 'image']) : "";
if ($this->getData(['theme', 'header', 'image']) &&
$imageFile !== '') {
$sizes = getimagesize('site/file/source/'.$this->getData(['theme','header','image']));
echo template::text('themeHeaderImageWidth', [
'value' => $sizes [0],
'noDirty' => true
]);
echo template::text('themeHeaderImageHeight', [
'value' => $sizes [1],
'noDirty' => true
]);
}
echo template::file('themeHeaderImage', [
'label' => 'Fond',
'type' => 1,