Solved icon attribute bug

This commit is contained in:
Kevin Frantz 2019-03-28 15:42:46 +01:00
parent 326390e7af
commit be91684f7f

View File

@ -26,9 +26,11 @@
{%- set is_dropdown = attributes.dropdown|default(false) %} {%- set is_dropdown = attributes.dropdown|default(false) %}
{%- set divider_prepend = attributes.divider_prepend|default(false) %} {%- set divider_prepend = attributes.divider_prepend|default(false) %}
{%- set divider_append = attributes.divider_append|default(false) %} {%- set divider_append = attributes.divider_append|default(false) %}
{% if item.attribute('icon') is not empty %}
{% set icon = item.attribute('icon') %}
{% endif %}
{# unset bootstrap specific attributes #} {# unset bootstrap specific attributes #}
{%- set attributes = attributes|merge({'dropdown': null, 'divider_prepend': null, 'divider_append': null }) %} {%- set attributes = attributes|merge({'dropdown': null, 'divider_prepend': null, 'divider_append': null,'icon': null}) %}
{%- if divider_prepend %} {%- if divider_prepend %}
{{ block('dividerElement') }} {{ block('dividerElement') }}
@ -138,8 +140,8 @@
{% import _self as ownmacro %} {% import _self as ownmacro %}
{{ ownmacro.setCssClassAttribute(item, 'LabelAttribute', 'dropdown-header') }} {{ ownmacro.setCssClassAttribute(item, 'LabelAttribute', 'dropdown-header') }}
<div {{ macros.attributes(item.labelAttributes) }}> <div {{ macros.attributes(item.labelAttributes) }}>
{% if item.attribute('icon') is not empty %} {% if icon is defined %}
<i class="{{ item.attribute('icon') }}"></i> <i class="{{ icon }}"></i>
{% endif %} {% endif %}
{{ block('label') }} {{ block('label') }}
</div> </div>
@ -162,8 +164,8 @@
{% import _self as ownmacro %} {% import _self as ownmacro %}
{{ ownmacro.setCssClassAttribute(item, 'LinkAttribute', 'nav-link') }} {{ ownmacro.setCssClassAttribute(item, 'LinkAttribute', 'nav-link') }}
<a href="{{ item.uri }}"{{ macros.attributes(item.linkAttributes) }}> <a href="{{ item.uri }}"{{ macros.attributes(item.linkAttributes) }}>
{% if item.attribute('icon') is not empty %} {% if icon is defined %}
<i class="{{ item.attribute('icon') }}"></i> <i class="{{ icon }}"></i>
{% endif %} {% endif %}
{{ block('label') }} {{ block('label') }}
</a> </a>
@ -174,8 +176,8 @@
{% import _self as ownmacro %} {% import _self as ownmacro %}
{{ ownmacro.setCssClassAttribute(item, 'LabelAttribute', 'navbar-text') }} {{ ownmacro.setCssClassAttribute(item, 'LabelAttribute', 'navbar-text') }}
<span {{ macros.attributes(item.labelAttributes) }}> <span {{ macros.attributes(item.labelAttributes) }}>
{% if item.attribute('icon') is not empty %} {% if icon is defined %}
<i class="{{ item.attribute('icon') }}"></i> <i class="{{ icon }}"></i>
{% endif %} {% endif %}
{{ block('label') }} {{ block('label') }}
</span> </span>
@ -189,8 +191,8 @@
{%- set attributes = attributes|merge({'class': classes|join(' ')}) %} {%- set attributes = attributes|merge({'class': classes|join(' ')}) %}
{%- set attributes = attributes|merge({'data-toggle': 'dropdown'}) %} {%- set attributes = attributes|merge({'data-toggle': 'dropdown'}) %}
<a href="#"{{ macros.attributes(attributes) }}> <a href="#"{{ macros.attributes(attributes) }}>
{% if item.attribute('icon') is not empty %} {% if icon is defined %}
<i class="{{ item.attribute('icon') }}"></i> <i class="{{ icon }}"></i>
{% endif %} {% endif %}
{{ block('label') }} {{ block('label') }}
<b class="caret"></b> <b class="caret"></b>