Skip to content

Commit

Permalink
pass all props to the trigger slot of NcPopover
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Nov 18, 2024
1 parent d6c20a3 commit be8c2f3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
5 changes: 3 additions & 2 deletions src/components/UserPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
</div>
</div>
</div>
<template #trigger>
<slot />
<!-- See https://nextcloud-vue-components.netlify.app/#/Components/NcPopover -->
<template #trigger="{ attrs }">
<slot name="trigger" v-bind="attrs" />
</template>
</NcPopover>
</template>
Expand Down
46 changes: 27 additions & 19 deletions src/views/GithubIssuePrReferenceWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,16 @@
:shown="showObjectAuthorPopover"
:subject-type="richObject.github_type"
:subject-id="richObject.id">
<a :href="'https://github.com/' + richObject.user.login"
target="_blank"
class="author-link"
@mouseenter="showObjectAuthorPopover = true"
@mouseleave="showObjectAuthorPopover = false">
{{ t('integration_github', 'by {creator}', { creator: richObject.user.login }) }}
</a>
<template #trigger="{ attrs }">
<a v-bind="attrs"
:href="'https://github.com/' + richObject.user.login"
target="_blank"
class="author-link"
@mouseenter="showObjectAuthorPopover = true"
@mouseleave="showObjectAuthorPopover = false">
{{ t('integration_github', 'by {creator}', { creator: richObject.user.login }) }}
</a>
</template>
</UserPopover>
&nbsp;
<span v-tooltip.top="{ content: subTextTooltip }"
Expand Down Expand Up @@ -112,12 +115,14 @@
:shown="showCommentAvatarPopover"
:subject-type="richObject.github_type"
:subject-id="richObject.id">
<NcAvatar
class="author-avatar"
:is-no-user="true"
:url="commentAuthorAvatarUrl"
@mouseenter.native="showCommentAvatarPopover = true"
@mouseleave.native="showCommentAvatarPopover = false" />
<template #trigger="{ attrs }">
<NcAvatar v-bind="attrs"
class="author-avatar"
:is-no-user="true"
:url="commentAuthorAvatarUrl"
@mouseenter.native="showCommentAvatarPopover = true"
@mouseleave.native="showCommentAvatarPopover = false" />
</template>
</UserPopover>
<span class="comment--content--bubble-tip" />
<span class="comment--content--bubble">
Expand All @@ -126,12 +131,15 @@
:shown="showCommentAuthorPopover"
:subject-type="richObject.github_type"
:subject-id="richObject.id">
<strong @mouseenter="showCommentAuthorPopover = true"
@mouseleave="showCommentAuthorPopover = false">
<a :href="commentAuthorUrl" target="_blank" class="author-link comment-author-display-name">
{{ richObject.github_comment?.user?.login }}
</a>
</strong>
<template #trigger="{ attrs }">
<strong v-bind="attrs"
@mouseenter="showCommentAuthorPopover = true"
@mouseleave="showCommentAuthorPopover = false">
<a :href="commentAuthorUrl" target="_blank" class="author-link comment-author-display-name">
{{ richObject.github_comment?.user?.login }}
</a>
</strong>
</template>
</UserPopover>
&nbsp;
<span v-tooltip.top="{ content: commentedAtTooltip }"
Expand Down

0 comments on commit be8c2f3

Please sign in to comment.