Revert header.js

This commit is contained in:
fredtempez 2021-03-22 18:51:40 +01:00
parent b9d4971aa6
commit ffe8e7aa8a
1 changed files with 9 additions and 20 deletions

View File

@ -12,7 +12,7 @@
* @link http://zwiicms.fr/
*/
$(document).ready(function(){
$(document).ready(function(){
$("header").css("line-height", "");
$("header").css("height", "");
});
@ -104,17 +104,12 @@ $("input, select").on("change", function() {
css += 'header{margin:0}';
}
// Position de la bannière
var headerPosition = $("#themeHeaderPosition").val();
var menuPosition = <?php echo json_encode($this->getData(['theme', 'menu', 'position'])); ?>;
console.clear();
console.log ("menu :" + menuPosition);
console.log ("header :" + headerPosition);
switch(headerPosition) {
switch($("#themeHeaderPosition").val()) {
case 'hide':
$("header").hide();
break;
case 'site':
if( menuPosition === 'site-first') {
if(<?php echo json_encode($this->getData(['theme', 'menu', 'position']) === 'site-first'); ?>) {
$("header").show().insertAfter("nav");
}
else {
@ -123,22 +118,16 @@ $("input, select").on("change", function() {
if(<?php echo json_encode($this->getData(['theme', 'menu', 'margin'])); ?>) {
css += 'nav{margin:0 20px}';
}
if (menuPosition === 'site-second') {
$("nav").show().prependTo("#site");
}
}
break;
case 'body':
if( menuPosition === 'body-first') {
if(<?php echo json_encode($this->getData(['theme', 'menu', 'position']) === 'body-first'); ?>) {
$("header").show().insertAfter("nav");
}
else {
$("header").show().insertAfter("#bar");
}
if ( menuPosition === "site-second") {
$("nav").show().insertBefore("header");
}
if( menuPosition === 'top') {
if(<?php echo json_encode($this->getData(['theme', 'menu', 'position']) === 'top'); ?>) {
$("header").show().insertAfter("nav");
}
break;