Skip to content

Commit

Permalink
Setting the expanded menu to show only if there are children under it.
Browse files Browse the repository at this point in the history
  • Loading branch information
maria-thinkshout committed Dec 10, 2021
1 parent 5809845 commit 38712fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion themes/custom/ts_wrin/ts_wrin.theme
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function ts_wrin_preprocess_block(array &$variables) {
];
if ($variables['plugin_id'] == 'menu_block:main' && isset($variables["content"]["#items"])) {
foreach ($variables["content"]["#items"] as $item) {
if ($item['in_active_trail']) {
if ($item['in_active_trail'] && $item['is_expanded']) {
$variables['attributes']['class'][] = 'has-active-trail';
break;
}
Expand Down

0 comments on commit 38712fd

Please sign in to comment.