Skip to content

Commit 55429f2

Browse files
authored
Merge pull request #320 from devforth/AdminForth/770
fix: show three-dots button even when only bulk actions exist
2 parents 4369994 + db0ebe1 commit 55429f2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

adminforth/spa/src/components/ThreeDotsMenu.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template >
2-
<template v-if="threeDotsDropdownItems?.length || customActions?.length">
2+
<template v-if="threeDotsDropdownItems?.length || customActions?.length || (bulkActions?.some(action => action.showInThreeDotsDropdown))">
33
<button
44
data-dropdown-toggle="listThreeDotsDropdown"
55
class="flex items-center py-2 px-2 text-sm font-medium text-lightThreeDotsMenuIconDots focus:outline-none bg-lightThreeDotsMenuIconBackground rounded border border-lightThreeDotsMenuIconBackgroundBorder hover:bg-lightThreeDotsMenuIconBackgroundHover hover:text-lightThreeDotsMenuIconDotsHover focus:z-10 focus:ring-4 focus:ring-lightThreeDotsMenuIconFocus dark:focus:ring-darkThreeDotsMenuIconFocus dark:bg-darkThreeDotsMenuIconBackground dark:text-darkThreeDotsMenuIconDots dark:border-darkThreeDotsMenuIconBackgroundBorder dark:hover:text-darkThreeDotsMenuIconDotsHover dark:hover:bg-darkThreeDotsMenuIconBackgroundHover rounded-default"
@@ -35,8 +35,14 @@
3535
</div>
3636
</a>
3737
</li>
38-
<li v-if="checkboxes.length" v-for="action in bulkActions.filter(a => a.showInThreeDotsDropdown)" :key="action.id">
39-
<a href="#" @click.prevent="startBulkAction(action.id)" class="block px-4 py-2 hover:text-lightThreeDotsMenuBodyTextHover hover:bg-lightThreeDotsMenuBodyBackgroundHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover">
38+
<li v-for="action in bulkActions.filter(a => a.showInThreeDotsDropdown)" :key="action.id">
39+
<a href="#" @click.prevent="startBulkAction(action.id)"
40+
class="block px-4 py-2 hover:text-lightThreeDotsMenuBodyTextHover hover:bg-lightThreeDotsMenuBodyBackgroundHover dark:hover:bg-darkThreeDotsMenuBodyBackgroundHover dark:hover:text-darkThreeDotsMenuBodyTextHover"
41+
:class="{
42+
'pointer-events-none': !checkboxes.length,
43+
'opacity-50': !checkboxes.length,
44+
'cursor-not-allowed': !checkboxes.length
45+
}">
4046
<div class="flex items-center gap-2">
4147
<component
4248
v-if="action.icon"

0 commit comments

Comments
 (0)