Skip to content

Commit 241aa8b

Browse files
committed
ensure actions are loaded in collection grid mode
1 parent 3cd616c commit 241aa8b

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

resources/js/components/collections/Listing.vue

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,40 @@
2828
:item="collection.id"
2929
@started="actionStarted"
3030
@completed="actionCompleted"
31-
v-slot="{ actions }"
31+
v-slot="{ actions, loadActions, shouldShowSkeleton }"
3232
>
33-
<Dropdown placement="left-start">
33+
<Dropdown
34+
placement="left-start"
35+
@mouseover="loadActions"
36+
@focus="loadActions"
37+
@click="loadActions"
38+
>
3439
<DropdownMenu>
3540
<DropdownItem v-if="collection.available_in_selected_site" :text="__('View')" icon="eye" :href="collection.entries_url" />
3641
<DropdownItem v-if="collection.available_in_selected_site && collection.url" :text="__('Visit URL')" icon="external-link" target="_blank" :href="collection.url" />
3742
<DropdownItem v-if="collection.editable" :text="__('Configure')" icon="cog" :href="collection.edit_url" />
3843
<DropdownItem v-if="collection.blueprint_editable" :text="__('Edit Blueprints')" icon="blueprint-edit" :href="collection.blueprints_url" />
3944
<DropdownItem v-if="collection.editable" :text="__('Scaffold Views')" icon="scaffold" :href="collection.scaffold_url" />
40-
<DropdownSeparator v-if="actions.length" />
41-
<DropdownItem
42-
v-for="action in actions"
43-
:key="action.handle"
44-
:text="__(action.title)"
45-
:icon="action.icon"
46-
:variant="action.dangerous ? 'destructive' : 'default'"
47-
@click="action.run"
48-
/>
45+
<DropdownSeparator v-if="shouldShowSkeleton || actions.length" />
46+
<template v-if="shouldShowSkeleton">
47+
<div v-for="index in 3" :key="index" class="contents">
48+
<ui-skeleton class="m-1 size-5" />
49+
<ui-skeleton
50+
class="mx-2 my-1.5 h-5"
51+
:class="index === 1 ? 'w-28' : index === 2 ? 'w-36' : 'w-24'"
52+
/>
53+
</div>
54+
</template>
55+
<template v-else>
56+
<DropdownItem
57+
v-for="action in actions"
58+
:key="action.handle"
59+
:text="__(action.title)"
60+
:icon="action.icon"
61+
:variant="action.dangerous ? 'destructive' : 'default'"
62+
@click="action.run"
63+
/>
64+
</template>
4965
</DropdownMenu>
5066
</Dropdown>
5167
</ItemActions>

0 commit comments

Comments
 (0)