mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
rdv: fullcalendar: manage event clicking
This commit is contained in:
parent
a54434a677
commit
07eb5c797a
@ -62,12 +62,15 @@ export default {
|
||||
selectable: true,
|
||||
select: this.onDateSelect,
|
||||
eventChange: this.onEventChange,
|
||||
eventClick: this.onEventClick,
|
||||
eventMouseEnter: this.onEventMouseEnter,
|
||||
eventMouseLeave: this.onEventMouseLeave,
|
||||
selectMirror: true,
|
||||
editable: true,
|
||||
headerToolbar: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,timeGridWeek,timeGridDay'
|
||||
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth,listWeek,listDay'
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -92,6 +95,17 @@ export default {
|
||||
},
|
||||
onEventChange(payload) {
|
||||
this.$store.dispatch('updateEvent', payload);
|
||||
},
|
||||
onEventClick(payload) {
|
||||
payload.event.setProp('backgroundColor','#3788d8');
|
||||
payload.event.setProp('textColor','#ffffff');
|
||||
this.$store.dispatch('updateEvent', payload);
|
||||
},
|
||||
onEventMouseEnter(payload) {
|
||||
payload.event.setProp('borderColor','#444444');
|
||||
},
|
||||
onEventMouseLeave(payload) {
|
||||
payload.event.setProp('borderColor','#ffffff');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -99,3 +113,4 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -118,7 +118,6 @@ const store = createStore({
|
||||
updateEvent({ commit }, payload) {
|
||||
console.log('### action updateEvent', payload);
|
||||
let startDateInput = document.getElementById("chill_calendarbundle_calendar_startDate");
|
||||
console.log(payload.event)
|
||||
startDateInput.value = payload.event.start.toISOString();
|
||||
let endDateInput = document.getElementById("chill_calendarbundle_calendar_endDate");
|
||||
endDateInput.value = payload.event.end.toISOString();
|
||||
|
@ -79,12 +79,14 @@ export default {
|
||||
let arr = results.filter(i => i.user.id === u.id).map(i =>
|
||||
({
|
||||
start: i.startDate.datetime,
|
||||
end: i.endDate.datetime
|
||||
end: i.endDate.datetime,
|
||||
//display: 'background' // can be an option for the disponibility
|
||||
})
|
||||
);
|
||||
calendarEvents.push({
|
||||
events: arr,
|
||||
color: u.color,
|
||||
textColor: '#444444',
|
||||
id: u.id
|
||||
})
|
||||
})
|
||||
@ -119,10 +121,14 @@ export default {
|
||||
let child = children[i];
|
||||
if (child.nodeType === Node.ELEMENT_NODE) {
|
||||
this.users.selected.forEach(u => {
|
||||
if (child.firstChild.innerText == u.username) {
|
||||
child.style.background = u.color;
|
||||
if (child.hasChildNodes()) {
|
||||
if (child.firstChild.innerText == u.username) {
|
||||
child.style.background = u.color;
|
||||
child.firstChild.style.color = '#444444';
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -150,16 +156,4 @@ export default {
|
||||
</script>
|
||||
|
||||
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
||||
<style lang="scss">
|
||||
span.multiselect__tag {
|
||||
background: var(--bs-chill-orange);
|
||||
}
|
||||
span.multiselect__option--highlight {
|
||||
&::after {
|
||||
background: var(--bs-chill-green);
|
||||
}
|
||||
&.multiselect__option--selected::after {
|
||||
background: var(--bs-chill-red);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user