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 : - Modifications :
- Une troisième langue d'administration est disponible : espagnol / castillan, - 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, - 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, - 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. - 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 : - Corrections :

View File

@ -607,8 +607,10 @@ $(document).ready(function(){
$("nav #menu ul li span").click(function() { $("nav #menu ul li span").click(function() {
// id de la page parent // id de la page parent
var parentId = $(this).parents().attr("id"); var parentId = $(this).parents().attr("id");
console.log(parentId);
var select = "ul#_"+parentId+".navSub"; 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" ) { if( $(select).css("z-index") === "-1" ) {
$(select).css("z-index","1"); $(select).css("z-index","1");
$(select).css("opacity","1"); $(select).css("opacity","1");
@ -634,4 +636,15 @@ $(document).ready(function(){
<?php } ?> <?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 // Mise en page de l'item
$itemsLeft .= '<li>'; $itemsLeft .= '<li>';
$pageDesactived = false;
if ( ( $this->getData(['page',$parentPageId,'disable']) === true AND $this->getUser('password') !== $this->getInput('DELTA_USER_PASSWORD')) 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 )) 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); $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">'; $itemsLeft .= '<div id="'.$parentPageId.'" class="box" style="display:flex; align-items:center;"><div><a class="A ' . $active . $parentPageId . ' disabled-link">';
$pageDesactived = true;
} else { } else {
$pageUrl = ($this->getData(['locale', 'homePageId']) === $parentPageId) ? helper::baseUrl(false) : helper::baseUrl() . $parentPageId; $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 . '>'; $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; 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 .= $iconSubExistLargeScreen;
$itemsLeft .= '</a>'; $itemsLeft .= '</a>';
$itemsLeft .= '</div>'; $itemsLeft .= '</div>';
@ -1845,6 +1849,7 @@ class common {
$targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : ''; $targetBlank = $this->getData(['page', $childKey, 'targetBlank']) ? ' target="_blank"' : '';
// Mise en page du sous-item // Mise en page du sous-item
$itemsLeft .= '<li>'; $itemsLeft .= '<li>';
$pageDesactived = false;
if ( ( $this->getData(['page',$childKey,'disable']) === true if ( ( $this->getData(['page',$childKey,'disable']) === true
AND $this->getUser('password') !== $this->getInput('DELTA_USER_PASSWORD') AND $this->getUser('password') !== $this->getInput('DELTA_USER_PASSWORD')
) OR ( ) OR (
@ -1855,6 +1860,7 @@ class common {
){ ){
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0); $pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
$itemsLeft .= '<a class="disabled-link">'; $itemsLeft .= '<a class="disabled-link">';
$pageDesactived = true;
} else { } else {
$pageUrl = ($this->getData(['locale', 'homePageId']) === $childKey) ? helper::baseUrl(false) : helper::baseUrl() . $childKey; $pageUrl = ($this->getData(['locale', 'homePageId']) === $childKey) ? helper::baseUrl(false) : helper::baseUrl() . $childKey;
$itemsLeft .= '<a class="' . $active . $parentPageId . '" href="' . $pageUrl . '"' . $targetBlank . '>'; $itemsLeft .= '<a class="' . $active . $parentPageId . '" href="' . $pageUrl . '"' . $targetBlank . '>';
@ -1890,6 +1896,8 @@ class common {
} }
break; 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 .= '</a></li>';
} }
$itemsLeft .= '</ul>'; $itemsLeft .= '</ul>';

View File

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