Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion themes/bootstrap5/templates/_ui/components/menu-button.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* @param string $toggleLabel The label for the toggle button (will be translated)
* @param ?string $wrapperTag Tag to use as a wrapper around the control (default = div)
* @param ?string $wrapperClass Extra CSS class(es) to apply to the wrapper tag
* @param ?string $menuAlign Alignment of the drop-down. Default is alignment with the start side of its parent.
* 'end' aligns with the end side of its parent.
*/
$wrapperTag = $this->wrapperTag ?? 'div';
$wrapperClass = 'dropdown'; // Bootstrap class
Expand Down Expand Up @@ -52,7 +54,13 @@
)
?>

<ul class="dropdown-menu">
<?php
$menuAttributes = $this->htmlAttributes(['class' => 'dropdown-menu']);
if ('end' == ($this->menuAlign ?? null)) {
$menuAttributes->add('class', 'dropdown-menu-end');
}
?>
<ul<?=$menuAttributes?>>
<?php foreach ($this->menuItems as $current): ?>
<li class="dropdown__item">
<a class="dropdown-item dropdown__link<?=($current['selected'] ?? false) ? ' active' : ''?>"
Expand Down