Skip to content

Commit 2575df0

Browse files
author
Florian Eckerstorfer
committed
Option to disable dropdown.
Fixes braincrafted#162
1 parent a7ce69d commit 2575df0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Resources/views/Menu/bootstrap.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
{% block dropdownList %}
6868
{% spaceless %}
69-
{% if item.hasChildren and options.depth is not sameas(0) and item.displayChildren %}
69+
{% if item.hasChildren and options.depth is not sameas(0) and ((item.extras.dropdown is not defined and item.displayChildren is sameas(true) or item.extras.dropdown is defined and item.extras.dropdown is sameas(true) and item.displayChildren is sameas(true))) %}
7070
{% set listAttributes = listAttributes|merge({'class': (listAttributes.class|default('') ~ ' dropdown-menu')|trim}) %}
7171
<ul{{ _self.attributes(listAttributes) }}>
7272
{{ block('children') }}
@@ -117,7 +117,7 @@
117117
{%- endif %}
118118
{%- if item.hasChildren and ((options.style is defined and options.style == 'list') or options.currentDepth is not sameas(1)) %}
119119
{%- set classes = classes|merge(['nav-header']) %}
120-
{%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] %}
120+
{%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] and ((item.extras.dropdown is not defined and item.displayChildren is sameas(true) or item.extras.dropdown is defined and item.extras.dropdown is sameas(true) and item.displayChildren is sameas(true))) %}
121121
{%- set classes = classes|merge(['dropdown']) %}
122122
{%- endif %}
123123

@@ -135,7 +135,7 @@
135135
{# displaying the item #}
136136
<li{{ _self.attributes(attributes) }}>
137137
{%- if attributes.divider is defined and attributes.divider is not empty %}
138-
{%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] and options.currentDepth is sameas(1) %}
138+
{%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'justified-tabs', 'pills', 'justified-pills', 'navbar', 'navbar-right', 'navbar_justified'] and options.currentDepth is sameas(1) and ((item.extras.dropdown is not defined and item.displayChildren is sameas(true) or item.extras.dropdown is defined and item.extras.dropdown is sameas(true) and item.displayChildren is sameas(true))) %}
139139
{{ block('dropdownElement') }}
140140
{%- elseif item.uri is not empty and ((matcher is defined and not matcher.isCurrent(item)) or options.currentAsLink) %}
141141
{{ block('linkElement') }}

0 commit comments

Comments
 (0)