Skip to content

Commit fa2fb0b

Browse files
cavasinfCavasin F
andauthored
[dropdown] change option menuArrowEnd to menuAlignementEnd (kevinpapst#244)
Co-authored-by: Cavasin F <florian@allsoftware.fr>
1 parent 6a3942e commit fa2fb0b

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

docs/components-dropdown.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ See Tabler documentation at https://preview.tabler.io/dropdowns.html
3636
| bodyExtraClass | Add extra class to the body | `string` | _empty string_ |
3737

3838
#### Options
39-
| Parameter | Description | Type | Default |
40-
|:------------:|--------------------------------------------|:---------:|:--------------:|
41-
| menuArrow | Add the Arrow to the dropdown | `boolean` | `false` |
42-
| menuArrowEnd | Place the arrow to the end of the dropdown | `boolean` | `false` |
43-
| extraClass | Add extra classes on dropdown container | `string` | _empty string_ |
39+
| Parameter | Description | Type | Default |
40+
|:----------------:|-----------------------------------------|:---------:|:--------------:|
41+
| menuAlignmentEnd | Align to end the dropdown menu | `boolean` | `false` |
42+
| menuArrow | Add the Arrow to the dropdown | `boolean` | `false` |
43+
| extraClass | Add extra classes on dropdown container | `string` | _empty string_ |
4444

4545
### Usage
4646

@@ -136,7 +136,7 @@ See Tabler documentation at https://preview.tabler.io/dropdowns.html
136136
title: 'Logout',
137137
icon: 'back',
138138
},
139-
], {extraClass : 'bg-dark text-white', menuArrow: true, menuArrowEnd: true}) }}
139+
], {extraClass : 'bg-dark text-white', menuArrow: true, menuAlignmentEnd: true}) }}
140140
```
141141

142142
## Next steps

templates/components/dropdown.html.twig

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@
33
{% from '@Tabler/components/badge.html.twig' import badge as badgeMacro %}
44

55
{# Options #}
6+
{# TODO : Remove when 3.0 #}
7+
{% if options.menuArrowEnd is defined %}
8+
{% deprecated "Using `menuArrowEnd` option is deprecated, use `menuAlignmentEnd` instead." %}
9+
{% set _menuAlignmentEnd = options.menuArrowEnd is same as true %}
10+
{% else %}
11+
{% set _menuAlignmentEnd = (options.menuAlignmentEnd ?? false) is same as true %}
12+
{% endif %}
13+
614
{% set _menuArrow = options.menuArrow ?? false %}
7-
{% set _menuArrowEnd = options.menuArrowEnd ?? false %}
815
{% set _extraClass = options.extraClass ?? '' %}
916

10-
<div class="dropdown-menu {% if _menuArrow %}dropdown-menu-arrow {% if _menuArrowEnd %}dropdown-menu-end{% endif %}{% endif %} {{ _extraClass }}">
17+
<div class="dropdown-menu {% if _menuArrow %}dropdown-menu-arrow{% endif %} {% if _menuAlignmentEnd %}dropdown-menu-end{% endif %} {{ _extraClass }}">
1118
{% for item in items %}
1219

1320
{# Item #}

0 commit comments

Comments
 (0)