Changes for page Menu Macro

Last modified by Sebastian Marsching on 2024/09/04 17:56

From version 7.1
edited by Sebastian Marsching
on 2024/08/10 15:00
Change comment: Install extension [org.xwiki.platform:xwiki-platform-menu-ui/15.10.11]
To version 8.1
edited by Sebastian Marsching
on 2024/09/04 17:56
Change comment: Install extension [org.xwiki.platform:xwiki-platform-menu-ui/15.10.12]

Summary

Details

XWiki.JavaScriptExtension[0]
Code
... ... @@ -70,6 +70,18 @@
70 70   $(dropDownHeader).next().addClass('xDropdown-menu');
71 71   });
72 72  
73 + $('.xDropdown-menu').each(function() {
74 + this.addEventListener('keyup', function(event) {
75 + if (event.key === 'Escape') {
76 + // We change the state of the parent xDropdown
77 + this.parentNode.classList.remove('open');
78 + // We set the focus on the toggle button of the section we just collapsed
79 + this.parentNode.querySelector(':scope > .xDropdown-header > .xDropdown-header-toggle').focus();
80 + }
81 + event.stopPropagation();
82 + });
83 + });
84 +
73 73   $('.menu-horizontal .xDropdown').each(function() {
74 74   // In case of horizontal menus, make it so that a class is added on hover, instead of using the :hover pseudo-class
75 75   this.addEventListener("mouseover", function() {
XWiki.StyleSheetExtension[1]
Code
... ... @@ -159,19 +159,19 @@
159 159   margin-top: 0;
160 160   border-top-right-radius: 0;
161 161   border-top-left-radius: 0;
162 + overflow-wrap: break-word;
163 + hyphens: auto;
162 162   li {
163 163   /* Text inside menu */
164 164   color: @dropdown-link-color;
167 + padding: 3px 20px;
165 165   /* Links inside menu */
166 166   a {
167 167   display: block;
168 - padding: 3px 20px;
169 169   clear: both;
170 170   font-weight: normal;
171 171   line-height: @line-height-base;
172 172   color: @dropdown-link-color;
173 - overflow: hidden;
174 - text-overflow: ellipsis; // Displaying ... if the text is too long
175 175   &:hover, &:focus-within {
176 176   /* &:extend(.dropdown-menu>li>a:hover); */
177 177   text-decoration: none;