diff --git a/core/core.js.php b/core/core.js.php
index adbdb993..30f9bbce 100755
--- a/core/core.js.php
+++ b/core/core.js.php
@@ -316,6 +316,7 @@ core.start = function() {
core.noticeAdd(_this.attr("id"), "Format incorrect");
}
});
+
/**
* Iframes et vidéos responsives
*/
@@ -338,7 +339,25 @@ core.start = function() {
});
}).trigger("resize");
+ /*
+ * Header responsive
+ */
+ $(window).on("resize", function() {
+ var responsive = "getdata(['theme','header','imageContainer']);?>";
+ if (responsive === "cover" || responsive === "contain" ) {
+ var widthpx = "getdata(['theme','site','width']);?>";
+ var width = widthpx.substr(0,widthpx.length-2);
+ var heightpx = "getdata(['theme','header','height']);?>";
+ var height = heightpx.substr(0,heightpx.length-2);
+ var ratio = width / height;
+ $("header").height( $(window).width() / ratio );
+ $("header").css("line-height", $(window).width() / ratio + "px");
+ }
+ }).trigger("resize");
+
};
+
+
core.start();
/**
diff --git a/core/core.php b/core/core.php
index a747e134..ecd4f07e 100644
--- a/core/core.php
+++ b/core/core.php
@@ -1286,22 +1286,9 @@ class core extends common {
$css .= 'header{background-size:' . $this->getData(['theme','header','imageContainer']).'}';
$css .= 'header{background-color:' . $colors['normal'];
+ // Valeur de hauteur traditionnelle
+ $css .= ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) ;
- if ($this->getData(['theme', 'header', 'height']) === 'none') {
- // Controle de l'existence du fichier
- if (file_exists(self::FILE_DIR.'source/' . $this->getData(['theme','header','image'])) &&
- $this->getData(['theme', 'header', 'image']) ) {
- // On établie la hauteur du div en proportion de l'image
- // (hauteur / largeur) . 100
- $sizes = getimagesize(self::FILE_DIR.'source/'.$this->getData(['theme','header','image']));
- $css .= ';height: 0; padding-top:';
- $css .= ( $sizes[1] / $sizes[0] )* 100;
- $css .= '%';
- }
- } else {
- // Valeur de hauteur traditionnelle
- $css .= ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) ;
- }
$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']) . '}';
diff --git a/core/layout/main.php b/core/layout/main.php
index cb1ae5ea..757f9455 100755
--- a/core/layout/main.php
+++ b/core/layout/main.php
@@ -57,19 +57,17 @@
getData(['theme','header','linkHomePage'])){
echo "" ;} ?>
+