|
107 | 107 | {% endfor %}
|
108 | 108 | {% endif %}
|
109 | 109 |
|
110 |
| - <!-- Determine whether to render item as a section --> |
111 |
| - {% set tabs = "navigation.tabs" in features %} |
112 |
| - {% set sections = "navigation.sections" in features %} |
113 |
| - {% if tabs and level == 1 or sections and tabs >= level - 1 %} |
114 |
| - {% set class = class ~ " md-nav__item--section" %} |
115 |
| - {% set is_section = true %} |
116 |
| - |
117 |
| - <!-- Determine whether to prune inactive item --> |
118 |
| - {% elif not nav_item.active and "navigation.prune" in features %} |
119 |
| - {% set class = class ~ " md-nav__item--pruned" %} |
120 |
| - {% set is_pruned = true %} |
| 110 | + <!-- Navigation tabs --> |
| 111 | + {% if "navigation.tabs" in features %} |
| 112 | + |
| 113 | + <!-- Render 1st level active item as section --> |
| 114 | + {% if level == 1 and nav_item.active %} |
| 115 | + {% set class = class ~ " md-nav__item--section" %} |
| 116 | + {% set is_section = true %} |
| 117 | + {% endif %} |
| 118 | + |
| 119 | + <!-- Navigation tabs + sections --> |
| 120 | + {% if "navigation.sections" in features %} |
| 121 | + |
| 122 | + <!-- Render 2nd level items with nested items as sections --> |
| 123 | + {% if level == 2 and nav_item.parent.active %} |
| 124 | + {% set class = class ~ " md-nav__item--section" %} |
| 125 | + {% set is_section = true %} |
| 126 | + {% endif %} |
| 127 | + {% endif %} |
| 128 | + |
| 129 | + <!-- Navigation sections --> |
| 130 | + {% elif "navigation.sections" in features %} |
| 131 | + |
| 132 | + <!-- Render 1st level items with nested items as sections --> |
| 133 | + {% if level == 1 %} |
| 134 | + {% set class = class ~ " md-nav__item--section" %} |
| 135 | + {% set is_section = true %} |
| 136 | + {% endif %} |
| 137 | + {% endif %} |
| 138 | + |
| 139 | + <!-- Navigation pruning --> |
| 140 | + {% if "navigation.prune" in features %} |
| 141 | + |
| 142 | + <!-- Prune item if it is not a section and not active --> |
| 143 | + {% if not is_section and not nav_item.active %} |
| 144 | + {% set class = class ~ " md-nav__item--pruned" %} |
| 145 | + {% set is_pruned = true %} |
| 146 | + {% endif %} |
121 | 147 | {% endif %}
|
122 | 148 |
|
123 | 149 | <!-- Nested navigation item -->
|
|
126 | 152 | {% set checked = "checked" if nav_item.active %}
|
127 | 153 |
|
128 | 154 | <!-- Determine checked and indeterminate state -->
|
129 |
| - {% set is_expanded = "navigation.expand" in features %} |
130 |
| - {% if is_expanded and not checked %} |
| 155 | + {% if "navigation.expand" in features and not checked %} |
131 | 156 | {% set indeterminate = "md-toggle--indeterminate" %}
|
132 | 157 | {% endif %}
|
133 | 158 |
|
|
0 commit comments