πŸ‡¨πŸ‡­Switzerland @mkalbere

Account created on 19 March 2007, over 17 years ago
#

Recent comments

πŸ‡¨πŸ‡­Switzerland mkalbere

Here is a very ugly, but working js workaround to remove empty menus, not clean, but my customer doesn't want to wait ;-)
It fit my needs, but maybe not all cases.

Drupal.behaviors.menu_hack = {
attach: function(context, settings) {
do {
$(".toolbar-menu-administration ul:not(:has(li))").remove();
$(".toolbar-menu-administration li.menu-item--expanded").each(function() {
if ($("ul", this).length == 0) {
$(this).remove();
}
})
} while ($(".toolbar-menu-administration ul:not(:has(li))").length > 0);
}
}

Production build 0.69.0 2024