Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing isActive if child is active #151

Merged
merged 1 commit into from Sep 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion Resources/views/layout/macros.html.twig
Expand Up @@ -37,7 +37,13 @@

{% macro menu_item(item) %}
{% if item.route or item.hasChildren %}
<li id="{{ item.identifier }}" class=" {{ item.isActive ? 'active' : '' }} {{ item.hasChildren? 'treeview' : '' }}">
{% set childIsActive = false %}
{% for child in item.children %}
{% if child.isActive %}
{% set childIsActive = true %}
{% endif %}
{% endfor %}
<li id="{{ item.identifier }}" class=" {{ (item.isActive or childIsActive) ? 'active' : '' }} {{ item.hasChildren? 'treeview' : '' }}">
<a href="{{ item.hasChildren ? '#': '/' in item.route ? item.route : path(item.route, item.routeArgs) }}">
{% if item.icon %} <i class="{{ item.icon }}"></i> {% endif %}
<span>{{ item.label }}</span>
Expand Down