forked from ZwiiCMS-Team/ZwiiCMS
Menu en position haute au-dessus du site : option fixe
This commit is contained in:
parent
1c271c6e33
commit
d2d250f648
@ -400,7 +400,8 @@ class common {
|
||||
'position' => 'site-second',
|
||||
'textAlign' => 'left',
|
||||
'textColor' => 'rgba(255, 255, 255, 1)',
|
||||
'textTransform' => 'none'
|
||||
'textTransform' => 'none',
|
||||
'fixed' => false
|
||||
],
|
||||
'site' => [
|
||||
'backgroundColor' => 'rgba(255, 255, 255, 1)',
|
||||
@ -1056,6 +1057,7 @@ class common {
|
||||
// Version 9.0.0
|
||||
if($this->getData(['core', 'dataVersion']) < 900) {
|
||||
$this->setData(['theme', 'site', 'blocks','100']);
|
||||
$this->setData(['theme', 'menu','fixed',false]);
|
||||
$this->setData(['core', 'dataVersion', 900]);
|
||||
$this->SaveData();
|
||||
}
|
||||
|
@ -223,6 +223,12 @@ td > .col12 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.container-large-fixed {
|
||||
width: 100%;
|
||||
position:fixed;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
/* Barre de membre */
|
||||
#bar {
|
||||
background: #212223;
|
||||
@ -316,6 +322,14 @@ body > nav {
|
||||
margin: 0 -10px;
|
||||
}
|
||||
/* Items du menu */
|
||||
|
||||
/* Barre de navigation fixe quand le menu est en-dehors du site */
|
||||
#navfixed {
|
||||
position: fixed;
|
||||
top:0;
|
||||
width:100%;
|
||||
z-index:100;
|
||||
}
|
||||
nav a > img {
|
||||
margin: -4px 0;
|
||||
vertical-align: middle;
|
||||
|
@ -20,7 +20,15 @@
|
||||
<?php $layout->showNotification(); ?>
|
||||
<?php if($this->getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'top' ): ?>
|
||||
<!-- Menu dans le fond du site avant la bannière -->
|
||||
<nav>
|
||||
<nav
|
||||
<?php
|
||||
// Détermine si le menu est fixe en haut de page lorsque l'utilisateur n'est pas connecté
|
||||
if($this->getData(['theme', 'menu', 'position']) === 'top' &&
|
||||
$this->getData(['theme', 'menu', 'fixed']) === true &&
|
||||
$this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD'))
|
||||
|
||||
{echo 'id="navfixed"';} ?>
|
||||
>
|
||||
<div id="toggle"><?php echo template::ico('menu'); ?></div>
|
||||
<div id="menu" class="
|
||||
<?php if($this->getData(['theme', 'menu', 'position']) === 'top'){echo 'container-large';}else{echo'container';}
|
||||
|
@ -137,16 +137,14 @@ class theme extends common {
|
||||
public static $menuPositionsSite = [
|
||||
'site-first' => 'Dans le site avant la bannière',
|
||||
'site-second' => 'Dans le site après la bannière',
|
||||
'top' => 'Au-dessus et en-dehors du site',
|
||||
'top' => 'En-dehors du site',
|
||||
'hide' => 'Caché'
|
||||
|
||||
];
|
||||
public static $menuPositionsBody = [
|
||||
'body-first' => 'Au dessus du site avant la bannière',
|
||||
'body-second' => 'Au dessus du site après la bannière',
|
||||
'top' => 'Au-dessus et en-dehors du site',
|
||||
'hide' => 'Caché'
|
||||
|
||||
];
|
||||
public static $radius = [
|
||||
'0' => 'Aucun',
|
||||
@ -397,6 +395,7 @@ class theme extends common {
|
||||
'textAlign' => $this->getInput('themeMenuTextAlign'),
|
||||
'textColor' => $this->getInput('themeMenuTextColor'),
|
||||
'textTransform' => $this->getInput('themeMenuTextTransform'),
|
||||
'fixed' => $this->getInput('themeMenuFixed', helper::FILTER_BOOLEAN)
|
||||
]]);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
|
@ -105,4 +105,15 @@ $("#themeMenuPosition").on("change", function() {
|
||||
$("#themeMenuMargin").prop("checked", false).trigger("change");
|
||||
});
|
||||
}
|
||||
}).trigger("change");
|
||||
// Affiche / Cache les options du menu fixe
|
||||
$("#themeMenuPosition").on("change", function() {
|
||||
if($(this).val() === 'top') {
|
||||
$("#themeMenuPositionFixed").slideDown();
|
||||
}
|
||||
else {
|
||||
$("#themeMenuPositionFixed").slideUp(function() {
|
||||
$("#themeMenuFixed").prop("checked", false).trigger("change");
|
||||
});
|
||||
}
|
||||
}).trigger("change");
|
@ -105,6 +105,12 @@
|
||||
'checked' => $this->getData(['theme', 'menu', 'margin'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div id="themeMenuPositionFixed" class="displayNone">
|
||||
<?php echo template::checkbox('themeMenuFixed', true, 'Menu fixe', [
|
||||
'checked' => $this->getData(['theme', 'menu', 'fixed'])
|
||||
]); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user