From 6f597ef6d0f33fb7be2eab86856780e5b0b848dc Mon Sep 17 00:00:00 2001 From: peshi Date: Sun, 22 Dec 2013 15:12:12 +0100 Subject: [PATCH 1/2] Fix #162 --- Resources/views/Menu/bootstrap.html.twig | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Resources/views/Menu/bootstrap.html.twig b/Resources/views/Menu/bootstrap.html.twig index cab6f14..5b93f24 100644 --- a/Resources/views/Menu/bootstrap.html.twig +++ b/Resources/views/Menu/bootstrap.html.twig @@ -135,14 +135,16 @@ {# displaying the item #} {%- if attributes.divider is defined and attributes.divider is not empty %} - {%- 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))) %} - {{ block('dropdownElement') }} + {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'pills', 'navbar', 'navbar-right'] 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))) %} + {{ block('dropdownElement') }} + {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'pills', 'navbar', 'navbar-right'] and options.currentDepth is sameas(1) and ((item.extras.dropdown is defined and item.extras.dropdown is sameas(false) or item.displayChildren(false) )) %} + {{ block('linkElement') }} {%- elseif item.uri is not empty and ((matcher is defined and not matcher.isCurrent(item)) or options.currentAsLink) %} - {{ block('linkElement') }} + {{ block('linkElement') }} {%- elseif item.uri is not empty and ((item.current is defined and not item.current) or options.currentAsLink) %} - {{ block('linkElement') }} + {{ block('linkElement') }} {%- else %} - {{ block('spanElement') }} + {{ block('spanElement') }} {%- endif %} {# render the list of children#} {%- set childrenClasses = item.childrenAttribute('class') is not empty ? [item.childrenAttribute('class')] : [] %} From 3edfa565fec185b0ca1a286fc7d2fc9c1faac268 Mon Sep 17 00:00:00 2001 From: peshi Date: Sun, 22 Dec 2013 15:31:27 +0100 Subject: [PATCH 2/2] Second attempt Fix #162 --- Resources/views/Menu/bootstrap.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/views/Menu/bootstrap.html.twig b/Resources/views/Menu/bootstrap.html.twig index 5b93f24..406fa84 100644 --- a/Resources/views/Menu/bootstrap.html.twig +++ b/Resources/views/Menu/bootstrap.html.twig @@ -135,9 +135,9 @@ {# displaying the item #} {%- if attributes.divider is defined and attributes.divider is not empty %} - {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'pills', 'navbar', 'navbar-right'] 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))) %} + {%- 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))) %} {{ block('dropdownElement') }} - {%- elseif item.hasChildren and options.style is defined and options.style in ['tabs', 'pills', 'navbar', 'navbar-right'] and options.currentDepth is sameas(1) and ((item.extras.dropdown is defined and item.extras.dropdown is sameas(false) or item.displayChildren(false) )) %} + {%- 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 defined and item.extras.dropdown is sameas(false) or item.displayChildren(false) )) %} {{ block('linkElement') }} {%- elseif item.uri is not empty and ((matcher is defined and not matcher.isCurrent(item)) or options.currentAsLink) %} {{ block('linkElement') }}