Skip to content
Snippets Groups Projects

Issue #278 Avoid deleting availabilities from the daily planning and add more…

1 file
+ 16
4
Compare changes
  • Side-by-side
  • Inline
@@ -47,12 +47,12 @@ function add_event(event, color, subjectId, locationId, boxBody) {
if (event_title === undefined || event_title === "") {
event_title = event.title;
}
eventElement.data('event', {
event_data = {
appointment_start: event.appointment_start,
appointment_end: event.appointment_end,
title: event_title,
stick: true,
color: color + " !important",
duration: event.duration,
original_duration: event.duration,
subject: event.subject,
@@ -70,8 +70,13 @@ function add_event(event, color, subjectId, locationId, boxBody) {
end: $.fullCalendar.moment(event.appointment_end)
},
borderColor: borderColor
}
});
if(color != undefined){
event_data['color'] = color + " !important";
}
eventElement.data('event', event_data);
eventElement.draggable({
zIndex: 999,
revert: true,
@@ -227,6 +232,10 @@ function get_subjects_events(day) {
}
function remove_event(event) {
if(event.className.includes("background-event")){ //avoid removing availabilities
return;
}
$('#calendar').fullCalendar('removeEvents', event.id);
var selector;
if (event.subject_id !== undefined) {
@@ -239,7 +248,10 @@ function remove_event(event) {
event.duration = event.original_duration;
event.removed = true;
//remove !important
event.color = event.color.substring(0, 7);
if(event.color != undefined){
event.color = event.color.substring(0, 7);
}
if (event.link_id !== undefined) {
eventsCleared.push(event.link_id);
} else {
Loading