mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
fix(Calendar): does not display events on the calendar when sliding the carusel to avoid showing overlapping events
This commit is contained in:
@@ -15,7 +15,8 @@ export default {
|
||||
'focusDate',
|
||||
'size',
|
||||
'events',
|
||||
'noMonthView'
|
||||
'noMonthView',
|
||||
'isSliding'
|
||||
],
|
||||
props: {
|
||||
year: Number,
|
||||
@@ -39,6 +40,9 @@ export default {
|
||||
return result;
|
||||
},
|
||||
eventsPerDayAndHour() {
|
||||
// return early if the calendar pane is sliding
|
||||
if (this.isSliding) return {};
|
||||
|
||||
const res = {};
|
||||
this.days.forEach(day => {
|
||||
let key = day.toDateString();
|
||||
|
||||
@@ -6,7 +6,13 @@ export default {
|
||||
return {
|
||||
carousel: null,
|
||||
queue: 0,
|
||||
offset: 0
|
||||
offset: 0,
|
||||
slideAnimation:false,
|
||||
}
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
isSliding: Vue.computed(() => this.slideAnimation),
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -34,6 +40,10 @@ export default {
|
||||
else
|
||||
this.carousel.prev();
|
||||
}
|
||||
this.slideAnimation = false;
|
||||
},
|
||||
slide(evt) {
|
||||
this.slideAnimation = true;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -45,7 +55,7 @@ export default {
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div ref="carousel" class="calendar-pane carousel slide" @[\`slid.bs.carousel\`]="slid" :data-queue="queue">
|
||||
<div ref="carousel" class="calendar-pane carousel slide" @[\`slide.bs.carousel\`]="slide" @[\`slid.bs.carousel\`]="slid" :data-queue="queue">
|
||||
<!--height calc function just for user testing purpose (has to be fixed)-->
|
||||
<div class="carousel-inner " style="height:calc(100vh - 220px); overflow:scroll">
|
||||
<div v-for="i in [...Array(3).keys()]" :key="i" class="carousel-item">
|
||||
|
||||
@@ -15,7 +15,8 @@ export default {
|
||||
'focusDate',
|
||||
'size',
|
||||
'events',
|
||||
'noMonthView'
|
||||
'noMonthView',
|
||||
'isSliding'
|
||||
],
|
||||
props: {
|
||||
year: Number,
|
||||
@@ -45,6 +46,9 @@ export default {
|
||||
|
||||
},
|
||||
eventsPerDayAndHour() {
|
||||
// return early if the calendar pane is sliding
|
||||
if (this.isSliding) return {};
|
||||
|
||||
const res = {};
|
||||
this.days.forEach(day => {
|
||||
let key = day.toDateString();
|
||||
|
||||
Reference in New Issue
Block a user