Skip to content

Commit

Permalink
Merge pull request #2718 from nextcloud/feature/2685/dashboard-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
raimund-schluessler authored Jun 2, 2022
2 parents e2987b8 + 427730e commit 46456eb
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/components/DashboardWidgetItem/DashboardWidgetItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,16 @@ This component is meant to be used inside a DashboardWidget component.
</p>
</div>
<Actions v-if="gotMenu" :force-menu="forceMenu" menu-align="right">
<ActionButton v-for="(m, menuItemId) in itemMenu"
:key="menuItemId"
:icon="m.icon"
:close-after-click="true"
@click.prevent.stop="$emit(menuItemId, item)">
{{ m.text }}
</ActionButton>
<!-- @slot This slot can be used to provide actions for each dashboard widget item. -->
<slot name="actions">
<ActionButton v-for="(m, menuItemId) in itemMenu"
:key="menuItemId"
:icon="m.icon"
:close-after-click="true"
@click.prevent.stop="$emit(menuItemId, item)">
{{ m.text }}
</ActionButton>
</slot>
</Actions>
</component>
</div>
Expand Down Expand Up @@ -175,7 +178,7 @@ export default {
}
},
gotMenu() {
return Object.keys(this.itemMenu).length !== 0
return Object.keys(this.itemMenu).length !== 0 || !!this.$slots.actions
},
gotOverlayIcon() {
return this.overlayIconUrl && this.overlayIconUrl !== ''
Expand Down

0 comments on commit 46456eb

Please sign in to comment.