améliorations menus en grand et petit écran

This commit is contained in:
Deltacms 2023-06-16 08:24:17 +02:00
parent 833efe165d
commit 91a1448e74
5 changed files with 34 additions and 7 deletions

View File

@ -4,7 +4,7 @@
- Modifications :
- Une troisième langue d'administration est disponible : espagnol / castillan,
- Thème / Menu : le menu en petit écran (burger) dispose maintenant de ses propres paramètres,
- Edition de page / emplacement dans le menu : une page désactivée est signalée par le curseur 'not-allowed' en grand écran et par son nom barré en petit écran,
- Edition de page / emplacement dans le menu : une page désactivée est signalée par le curseur 'not-allowed' en grand écran et par une icône en petit écran, son lien est inactif,
- Nouveaux gabarits pour l'éditeur Tinymce : accordéon à 3 et 4 paragraphes,
- Statislite 4.8 : comptage des liens cliqués pour lesquels la class 'clicked_link_count' a été ajoutée par l'éditeur de liens de Tinymce.
- Corrections :

View File

@ -607,8 +607,10 @@ $(document).ready(function(){
$("nav #menu ul li span").click(function() {
// id de la page parent
var parentId = $(this).parents().attr("id");
console.log(parentId);
var select = "ul#_"+parentId+".navSub";
var select2 = "nav #menu ul li #" + parentId + " span";
var select2 = 'nav #menu ul li #' + parentId + ' span.iconSubExistSmallScreen';
console.log(select2);
if( $(select).css("z-index") === "-1" ) {
$(select).css("z-index","1");
$(select).css("opacity","1");
@ -632,6 +634,17 @@ $(document).ready(function(){
<?php if( $this->getData(['theme','menu', 'burgerFixed'])=== true && $this->getData(['theme','header', 'position'])=== 'site' && $this->getData(['theme','header', 'tinyHidden'])=== false && ( $this->getData(['theme','header', 'homePageOnly'])=== false || $this->getUrl(0) === $this->getData(['locale','homePageId']) ) ){ ?>
$("#site.container").css("padding-top","0");
<?php } ?>
}
}
/* Signalisation qu'une page désactivée en petit écran
* pour la page ou la sous-page cliquée
*/
if($(window).width() < 800) {
$("nav #menu a.disabled-link").click(function() {
var parentIdSubPage = $(this).parents("ul").attr("id");
var parentIdPage = $(this).parents().parents().attr("id");
$("nav #menu ul li ul li #"+parentIdSubPage+" .linkDisabledSmallScreen").css("display","inline");
$("nav #menu ul li #"+parentIdPage+" .linkDisabledSmallScreen").css("display","inline");
});
}
});

View File

@ -1795,11 +1795,13 @@ class common {
}
// Mise en page de l'item
$itemsLeft .= '<li>';
$pageDesactived = false;
if ( ( $this->getData(['page',$parentPageId,'disable']) === true AND $this->getUser('password') !== $this->getInput('DELTA_USER_PASSWORD'))
OR ( $this->getData(['page',$parentPageId,'disable']) === true AND $this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')AND $this->getUser('group') < self::GROUP_EDITOR ))
{
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
$itemsLeft .= '<div id="'.$parentPageId.'" class="box" style="display:flex; align-items:center;"><div><a class="A ' . $active . $parentPageId . ' disabled-link">';
$pageDesactived = true;
} else {
$pageUrl = ($this->getData(['locale', 'homePageId']) === $parentPageId) ? helper::baseUrl(false) : helper::baseUrl() . $parentPageId;
$itemsLeft .= '<div id="'.$parentPageId.'" class="box '.$active.'" style="display:flex; align-items:center;"><div><a class="B ' . $active . $parentPageId . '" href="' . $pageUrl . '"' . $targetBlank . '>';
@ -1828,6 +1830,8 @@ class common {
}
break;
}
$fileIcon = './site/file/source/icones/disabledPage.gif';
if( file_exists($fileIcon) && $pageDesactived) $itemsLeft .='<span class="linkDisabledSmallScreen" style="font-size:1em"><img src="'. $fileIcon .'" style="height:15px; width:auto;" alt=""></span>';
$itemsLeft .= $iconSubExistLargeScreen;
$itemsLeft .= '</a>';
$itemsLeft .= '</div>';
@ -1845,6 +1849,7 @@ class common {
$targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : '';
// Mise en page du sous-item
$itemsLeft .= '<li>';
$pageDesactived = false;
if ( ( $this->getData(['page',$childKey,'disable']) === true
AND $this->getUser('password') !== $this->getInput('DELTA_USER_PASSWORD')
) OR (
@ -1855,6 +1860,7 @@ class common {
){
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
$itemsLeft .= '<a class="disabled-link">';
$pageDesactived = true;
} else {
$pageUrl = ($this->getData(['locale', 'homePageId']) === $childKey) ? helper::baseUrl(false) : helper::baseUrl() . $childKey;
$itemsLeft .= '<a class="' . $active . $parentPageId . '" href="' . $pageUrl . '"' . $targetBlank . '>';
@ -1890,6 +1896,8 @@ class common {
}
break;
}
$fileIcon = './site/file/source/icones/disabledPage.gif';
if( file_exists($fileIcon) && $pageDesactived) $itemsLeft .='<span class="linkDisabledSmallScreen" style="font-size:1em"><img src="'. $fileIcon .'" style="height:15px; width:auto;" alt=""></span>';
$itemsLeft .= '</a></li>';
}
$itemsLeft .= '</ul>';

View File

@ -42,11 +42,13 @@
nav .iconSubExistLargeScreen{
display:inline;
margin-left :5px;
font-weight: bolder;
}
nav .iconSubExistSmallScreen{
display:none;
}
nav .linkDisabledSmallScreen{
display:none;
}
/* Corps */
section {
padding: 20px;
@ -183,9 +185,6 @@
body > nav {
margin: 0 auto !important ;
}
nav a.disabled-link {
text-decoration:line-through;
}
nav{
padding: 0;
}
@ -195,6 +194,10 @@
nav .iconSubExistSmallScreen{
display:inline;
}
nav .linkDisabledSmallScreen{
display:none;
margin-left:20px;
}
/*bandeau flex*/
nav #toggle {
display: flex;
@ -236,6 +239,9 @@
overflow-x: hidden;
overflow-y: auto;
}
nav #menu a{
padding:10px 10px;
}
nav li {
display: block;
}