Skip to content

Commit be8c2f3

Browse files
committed
pass all props to the trigger slot of NcPopover
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 parent d6c20a3 commit be8c2f3

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

src/components/UserPopover.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
</div>
3535
</div>
3636
</div>
37-
<template #trigger>
38-
<slot />
37+
<!-- See https://nextcloud-vue-components.netlify.app/#/Components/NcPopover -->
38+
<template #trigger="{ attrs }">
39+
<slot name="trigger" v-bind="attrs" />
3940
</template>
4041
</NcPopover>
4142
</template>

src/views/GithubIssuePrReferenceWidget.vue

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,16 @@
7272
:shown="showObjectAuthorPopover"
7373
:subject-type="richObject.github_type"
7474
:subject-id="richObject.id">
75-
<a :href="'https://github.com/' + richObject.user.login"
76-
target="_blank"
77-
class="author-link"
78-
@mouseenter="showObjectAuthorPopover = true"
79-
@mouseleave="showObjectAuthorPopover = false">
80-
{{ t('integration_github', 'by {creator}', { creator: richObject.user.login }) }}
81-
</a>
75+
<template #trigger="{ attrs }">
76+
<a v-bind="attrs"
77+
:href="'https://github.com/' + richObject.user.login"
78+
target="_blank"
79+
class="author-link"
80+
@mouseenter="showObjectAuthorPopover = true"
81+
@mouseleave="showObjectAuthorPopover = false">
82+
{{ t('integration_github', 'by {creator}', { creator: richObject.user.login }) }}
83+
</a>
84+
</template>
8285
</UserPopover>
8386
&nbsp;
8487
<span v-tooltip.top="{ content: subTextTooltip }"
@@ -112,12 +115,14 @@
112115
:shown="showCommentAvatarPopover"
113116
:subject-type="richObject.github_type"
114117
:subject-id="richObject.id">
115-
<NcAvatar
116-
class="author-avatar"
117-
:is-no-user="true"
118-
:url="commentAuthorAvatarUrl"
119-
@mouseenter.native="showCommentAvatarPopover = true"
120-
@mouseleave.native="showCommentAvatarPopover = false" />
118+
<template #trigger="{ attrs }">
119+
<NcAvatar v-bind="attrs"
120+
class="author-avatar"
121+
:is-no-user="true"
122+
:url="commentAuthorAvatarUrl"
123+
@mouseenter.native="showCommentAvatarPopover = true"
124+
@mouseleave.native="showCommentAvatarPopover = false" />
125+
</template>
121126
</UserPopover>
122127
<span class="comment--content--bubble-tip" />
123128
<span class="comment--content--bubble">
@@ -126,12 +131,15 @@
126131
:shown="showCommentAuthorPopover"
127132
:subject-type="richObject.github_type"
128133
:subject-id="richObject.id">
129-
<strong @mouseenter="showCommentAuthorPopover = true"
130-
@mouseleave="showCommentAuthorPopover = false">
131-
<a :href="commentAuthorUrl" target="_blank" class="author-link comment-author-display-name">
132-
{{ richObject.github_comment?.user?.login }}
133-
</a>
134-
</strong>
134+
<template #trigger="{ attrs }">
135+
<strong v-bind="attrs"
136+
@mouseenter="showCommentAuthorPopover = true"
137+
@mouseleave="showCommentAuthorPopover = false">
138+
<a :href="commentAuthorUrl" target="_blank" class="author-link comment-author-display-name">
139+
{{ richObject.github_comment?.user?.login }}
140+
</a>
141+
</strong>
142+
</template>
135143
</UserPopover>
136144
&nbsp;
137145
<span v-tooltip.top="{ content: commentedAtTooltip }"

0 commit comments

Comments
 (0)