Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
samipe committed May 5, 2024
1 parent c2707ee commit a4681e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<calendar-icon size="1rem" color="white" class="mr-2xsmall" style="transform: translateY(-2px)" />
{{ getDateString(new Date(event.date), new Date(event.dateEnd)) }}
</div>
<div v-if="event.location.trim() !== ''" class="flex">
<div v-if="event.location && event.location.trim() !== ''" class="flex">
<marker-icon class="mr-2xsmall" size="1rem" style="transform: translateY(3px)" />
{{ event.location }}
</div>
Expand Down Expand Up @@ -152,6 +152,9 @@ export default {
}
},
async mounted() {
this.$refs.container.addEventListener('click', () => {
window.plausible('Interact', { props: { section: 'Calendar' } })
}, { passive: true })
this.events = (await getEvents()).sort((a, b) => {
if (new Date(a.date) < new Date(b.date)) return -1
return 1
Expand Down Expand Up @@ -180,7 +183,7 @@ export default {
})
},
expand(target) {
if (!this.expanded) {
if (!this.expanded && target) {
setTimeout(() => {
const bottomVisible = (window.innerHeight - target.getBoundingClientRect().bottom) > 30
if (!bottomVisible) this.$refs.container.scrollIntoView({ behavior: 'smooth', block: 'end' })
Expand Down
3 changes: 3 additions & 0 deletions src/components/News.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export default {
}
},
async mounted() {
this.$refs.container.addEventListener('click', () => {
window.plausible('Interact', { props: { section: 'News' } })
}, { passive: true })
this.news = (await getNews()).sort((a, b) => {
if (new Date(a.date) > new Date(b.date)) return -1
return 1
Expand Down

0 comments on commit a4681e6

Please sign in to comment.