[9.2.03] correction sticky menu

This commit is contained in:
fredtempez 2019-07-28 17:01:46 +02:00
parent 2120ee51f8
commit fdd09c0f65
5 changed files with 35 additions and 25 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## Version 9.2.03
- Corrections :
- Menu fixe en dehors du site : impossibilité de sélectionner un élément sous un sous-menu.
- Modification de structure du fichier main.php
## Version 9.2.02 ## Version 9.2.02
- Correction : - Correction :

View File

@ -216,6 +216,7 @@ core.start = function() {
menuDOM.css("display", ""); menuDOM.css("display", "");
} }
}); });
/** /**
* Message sur l'utilisation des cookies * Message sur l'utilisation des cookies
*/ */
@ -328,16 +329,6 @@ core.start = function() {
}); });
}).trigger("resize"); }).trigger("resize");
// Ajouter l'attribut data-lity afin de faire la liaison avec lity
//$("a[rel='data-lity']").attr("data-lity","");
// Ajouter la classe Gallery afin de faire la liaison avec simplelightbox
//$("a[rel='gallery']").addClass("gallery","");
// Appel dans init.js
// $('.gallery').simpleLightbox();
}; };
core.start(); core.start();
@ -369,3 +360,19 @@ core.relativeLuminanceW3C = function(rgba) {
var B = (BsRGBA <= .03928) ? BsRGBA / 12.92 : Math.pow((BsRGBA + .055) / 1.055, 2.4); var B = (BsRGBA <= .03928) ? BsRGBA / 12.92 : Math.pow((BsRGBA + .055) / 1.055, 2.4);
return .2126 * R + .7152 * G + .0722 * B; return .2126 * R + .7152 * G + .0722 * B;
}; };
$(document).ready(function(){
/**
* Affiche le sous-menu quand il est sticky
*/
$("nav").mouseenter(function(){
$("#navfixedlogout .navLevel2").css({ 'pointer-events' : 'auto' });
$("#navfixedconnected .navLevel2").css({ 'pointer-events' : 'auto' });
});
$("nav").mouseleave(function(){
$("#navfixedlogout .navLevel2").css({ 'pointer-events' : 'none' });
$("#navfixedconnected .navLevel2").css({ 'pointer-events' : 'none' });
});
});

View File

@ -32,7 +32,7 @@ class common {
const TEMP_DIR = 'site/tmp/'; const TEMP_DIR = 'site/tmp/';
// Numéro de version // Numéro de version
const ZWII_VERSION = '9.2.02'; const ZWII_VERSION = '9.2.03';
public static $actions = []; public static $actions = [];
public static $coreModuleIds = [ public static $coreModuleIds = [
@ -2141,7 +2141,7 @@ class layout extends common {
empty($childrenPageIds)) { empty($childrenPageIds)) {
continue; continue;
} }
$items .= '<ul>'; $items .= '<ul class="navLevel2">';
foreach($childrenPageIds as $childKey) { foreach($childrenPageIds as $childKey) {
// Propriétés de l'item // Propriétés de l'item
$active = ($childKey === $currentPageId) ? ' class="active"' : ''; $active = ($childKey === $currentPageId) ? ' class="active"' : '';
@ -2205,7 +2205,7 @@ class layout extends common {
'">Connexion</a></li>'; '">Connexion</a></li>';
} }
// Retourne les items du menu // Retourne les items du menu
echo '<ul>' . $items . '</ul>'; echo '<ul class="navLevel1">' . $items . '</ul>';
} }
/** /**

View File

@ -454,6 +454,7 @@ nav li ul li {
display: block; display: block;
text-align: left; text-align: left;
} }
nav li:hover ul { nav li:hover ul {
z-index: 8; z-index: 8;
opacity: 1; opacity: 1;
@ -472,7 +473,6 @@ nav a:hover {
nav #menu { nav #menu {
display: block; display: block;
} }
} }
@media (max-width: 768px) { @media (max-width: 768px) {
@ -518,8 +518,10 @@ nav a:hover {
position: sticky; position: sticky;
} }
#navfixedconnected .navLevel2,
#navfixedlogout .navLevel2 {
pointer-events: none;
}
/* Menu vertical */ /* Menu vertical */
@ -933,7 +935,7 @@ label {
padding: 10px 0; padding: 10px 0;
background: #F5F5F5; background: #F5F5F5;
text-align: center; text-align: center;
float: right; /*float: right;*/
min-height :100%; min-height :100%;
} }
.inputFile:hover { .inputFile:hover {

View File

@ -40,11 +40,8 @@
?> ?>
> >
<div id="toggle"><?php echo template::ico('menu',null,null,'2em'); ?></div> <div id="toggle"><?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class=" <div id="menu" class="<?php if($this->getData(['theme', 'menu', 'position']) === 'top'){echo 'container-large';}else{echo'container';}
<?php if($this->getData(['theme', 'menu', 'position']) === 'top'){echo 'container-large';}else{echo'container';} ?>"><?php $layout->showMenu(); ?>
?>">
<?php $layout->showMenu(); ?>
</div> </div>
</nav> </nav>
<?php endif; ?> <?php endif; ?>