File tree Expand file tree Collapse file tree 1 file changed +23
-11
lines changed
Expand file tree Collapse file tree 1 file changed +23
-11
lines changed Original file line number Diff line number Diff line change 55
66<script setup lang="ts">
77import { t } from ' @nextcloud/l10n'
8+ import { computed } from ' vue'
89import IconReload from ' vue-material-design-icons/Reload.vue'
910
1011const props = defineProps <{
@@ -14,16 +15,31 @@ const props = defineProps<{
1415 isRecurring? : boolean
1516 href? : string
1617}>()
18+
19+ const event = computed (() => {
20+ if (props .href ) {
21+ return {
22+ component: ' a' ,
23+ attrs: {
24+ href: props .href ,
25+ title: t (' spreed' , ' Open Calendar' ),
26+ tabindex: 0 ,
27+ target: ' _blank' ,
28+ },
29+ }
30+ }
31+
32+ return {
33+ component: ' span' ,
34+ }
35+ })
1736 </script >
1837
1938<template >
2039 <li class =" calendar-event" >
21- <a class =" calendar-event__item"
22- :class =" { 'calendar-event__item--thumb': !href }"
23- :href =" href"
24- :title =" href ? t('spreed', 'Open Calendar') : name ?? undefined"
25- :tabindex =" 0"
26- target =" _blank" >
40+ <component :is =" event.component"
41+ class =" calendar-event__item"
42+ v-bind =" event.attrs" >
2743 <span class =" calendar-event__badge" :style =" { backgroundColor: color }" />
2844 <span class =" calendar-event__content" >
2945 <span class =" calendar-event__header" >
@@ -32,7 +48,7 @@ const props = defineProps<{
3248 </span >
3349 <span >{{ start }}</span >
3450 </span >
35- </a >
51+ </component >
3652 </li >
3753</template >
3854
@@ -47,10 +63,6 @@ const props = defineProps<{
4763 height : 100% ;
4864 border-radius : var (--border-radius );
4965
50- & --thumb {
51- cursor : default ;
52- }
53-
5466 & :hover {
5567 background-color : var (--color-background-hover );
5668 }
You can’t perform that action at this time.
0 commit comments