Skip to content
Snippets Groups Projects
Commit d8f65acc authored by Simon Bäse's avatar Simon Bäse
Browse files

Issue #3410295 by simonbaese, anthonygray47: Active trail indicator is...

Issue #3410295 by simonbaese, anthonygray47: Active trail indicator is overwritten by current page indicator
parent f3b7c984
No related branches found
No related tags found
1 merge request!9Issue #3410295: Active trail indicator is overwritten by current page indicator
Pipeline #66913 passed
......@@ -138,12 +138,19 @@ class ExpandBookManager extends BookManager {
$element['is_collapsed'] = TRUE;
}
// Set a helper variable to indicate if the link is in the active trail.
// Set a helper variable to indicate whether the link is in the active
// trail.
$element['in_active_trail'] = FALSE;
if ($data['link']['in_active_trail']) {
$element['in_active_trail'] = TRUE;
}
// Set a helper variable to indicate whether the link is the active link.
$element['is_active'] = FALSE;
if (($node instanceof NodeInterface) && $data['link']['nid'] === $node->id()) {
$element['is_active'] = TRUE;
}
// Allow book-specific theme overrides.
$element['attributes'] = new Attribute();
$element['title'] = $data['link']['title'];
......@@ -151,11 +158,6 @@ class ExpandBookManager extends BookManager {
'langcode' => $langcode,
]);
$element['in_active_trail'] = FALSE;
if (($node instanceof NodeInterface) && $data['link']['nid'] == $node->id()) {
$element['in_active_trail'] = TRUE;
}
$element['localized_options'] = !empty($data['link']['localized_options']) ? $data['link']['localized_options'] : [];
$element['localized_options']['set_active_class'] = TRUE;
$element['below'] = $data['below'] ? $this->buildItems($data['below']) : [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment