Skip to content

Commit 07f5409

Browse files
committed
fix(NcUserBubble): indicate that element is clickable
Signed-off-by: Maksim Sukharev <[email protected]>
1 parent bb79505 commit 07f5409

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

src/components/NcUserBubble/NcUserBubble.vue

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,29 @@ This component has the following slot:
2424
</p>
2525
```
2626

27+
### Example with click event
28+
29+
```vue
30+
<template>
31+
<NcUserBubble
32+
:margin="4"
33+
:size="30"
34+
display-name="Administrator"
35+
@click="alert"
36+
user="admin">
37+
</NcUserBubble>
38+
</template>
39+
<script>
40+
export default {
41+
methods: {
42+
alert() {
43+
alert('Clicked')
44+
},
45+
},
46+
}
47+
</script>
48+
```
49+
2750
### Example with name slot
2851

2952
```vue
@@ -71,7 +94,7 @@ export default {
7194
class="user-bubble__content"
7295
:style="styles.content"
7396
:href="hasUrl ? url : null"
74-
:class="{ 'user-bubble__content--primary': primary }"
97+
:class="{ 'user-bubble__content--primary': primary, 'user-bubble__content--clickable': isClickable }"
7598
v-bind="attrs"
7699
@click="onClick">
77100
<!-- NcAvatar -->
@@ -250,6 +273,10 @@ export default {
250273
return true
251274
},
252275
276+
isClickable() {
277+
return !!this.$listeners?.click || !this.popoverEmpty
278+
},
279+
253280
styles() {
254281
return {
255282
content: {
@@ -305,6 +332,10 @@ export default {
305332
background-color: var(--color-primary-element);
306333
}
307334
335+
&--clickable, &--clickable * {
336+
cursor: pointer;
337+
}
338+
308339
> :last-child {
309340
// border radius left padding
310341
padding-right: 8px;

0 commit comments

Comments
 (0)