Skip to content

Commit e501a34

Browse files
committed
Don't generate dropdown if the action group has only 1 action.
1 parent e7aaa42 commit e501a34

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

templates/element/action-groups.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
?>
1616

1717
<?php foreach ($groups as $key => $group) : ?>
18+
<?php
19+
if (count($group) === 1) {
20+
$subaction = key($group);
21+
if (is_numeric($subaction)) {
22+
$subaction = $group[$subaction];
23+
}
24+
25+
echo $this->element('action-button', ['config' => $links[$subaction]]);
26+
continue;
27+
}
28+
?>
1829
<div class='btn-group' role="group">
1930
<button type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
2031
<?= $key ?>

0 commit comments

Comments
 (0)