diff options
| author | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2026-03-16 12:09:07 +0100 |
|---|---|---|
| committer | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2026-03-16 12:09:07 +0100 |
| commit | e9687744733f40f4290111eadeaafa4213132b32 (patch) | |
| tree | 7072d3e1800efc13c1ff5e7e40d7b8e877ebf422 | |
| parent | 59f04b1e31bcfa663e262feef85fdf967c58a9ac (diff) | |
remove label wrapper for button in action menu, fixes #6361
Closes #6361
Merge request studip/studip!4821
| -rw-r--r-- | resources/assets/stylesheets/scss/actionmenu.scss | 9 | ||||
| -rw-r--r-- | resources/vue/components/StudipActionMenu.vue | 16 | ||||
| -rw-r--r-- | templates/shared/action-menu.php | 23 |
3 files changed, 17 insertions, 31 deletions
diff --git a/resources/assets/stylesheets/scss/actionmenu.scss b/resources/assets/stylesheets/scss/actionmenu.scss index 9ef7c0d..decaf32 100644 --- a/resources/assets/stylesheets/scss/actionmenu.scss +++ b/resources/assets/stylesheets/scss/actionmenu.scss @@ -97,11 +97,11 @@ $action-menu-shadow: 2px 2px 0 var(--color--action-menu-shadow); border-left: solid 4px transparent; > a, + > button, > label { margin: 0; padding: 2px 30px 2px 0; display: block; - align-items: center; } .action-menu-item-icon { @@ -112,11 +112,10 @@ $action-menu-shadow: 2px 2px 0 var(--color--action-menu-shadow); } > button { - background: transparent; + background-color: unset; border: 0; - line-height: 20px; - margin: 0; - padding: 3px 0; + text-align: left; + width: 100%; } > label, diff --git a/resources/vue/components/StudipActionMenu.vue b/resources/vue/components/StudipActionMenu.vue index bb189f8..db6d267 100644 --- a/resources/vue/components/StudipActionMenu.vue +++ b/resources/vue/components/StudipActionMenu.vue @@ -33,20 +33,14 @@ <span v-else class="action-menu-no-icon"></span> {{ item.label }} </a> - <label v-else-if="item.icon" class="undecorated" v-on="linkEvents(item)" tabindex="0"> - <studip-icon :shape="item.icon" - :name="item.name" + <button v-else :name="item.name" v-bind="item.attributes" v-on="linkEvents(item)"> + <studip-icon v-if="item.icon" + :shape="item.icon" class="action-menu-item-icon" - v-bind="item.attributes" /> + <span v-else class="action-menu-no-icon"></span> {{ item.label }} - </label> - <template v-else> - <span class="action-menu-no-icon"></span> - <button :name="item.name" v-bind="item.attributes" v-on="linkEvents(item)"> - {{ item.label }} - </button> - </template> + </button> </li> </ul> </div> diff --git a/templates/shared/action-menu.php b/templates/shared/action-menu.php index 5b105b2..a450e22 100644 --- a/templates/shared/action-menu.php +++ b/templates/shared/action-menu.php @@ -54,21 +54,14 @@ <?= htmlReady($action['label']) ?> </a> <? elseif ($action['type'] === 'button'): ?> - <? if ($action['icon']): ?> - <label class="undecorated" tabindex="0"> - <?= $action['icon']->asInput(false, $action['attributes'] + [ - 'class' => 'action-menu-item-icon', - 'name' => $action['name'], - 'title' => $action['label'], - ], true) ?> - <?= htmlReady($action['label']) ?> - </label> - <? else: ?> - <span class="action-menu-no-icon"></span> - <button name="<?= htmlReady($action['name']) ?>" <?= arrayToHtmlAttributes($action['attributes']) ?>> - <?= htmlReady($action['label']) ?> - </button> - <? endif ?> + <button name="<?= htmlReady($action['name']) ?>" <?= arrayToHtmlAttributes($action['attributes']) ?>> + <? if ($action['icon']): ?> + <?= $action['icon']->asImg(false, ['class' => 'action-menu-item-icon']) ?> + <? else: ?> + <span class="action-menu-no-icon"></span> + <? endif ?> + <?= htmlReady($action['label']) ?> + </button> <? elseif ($action['type'] === 'multi-person-search'): ?> <?= $action['object']->render() ?> <? elseif ($action['type'] === 'separator'): ?> |
