From b20cd869162bc15e9230b87318db4e388dc527e7 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Fri, 20 Oct 2017 12:41:47 +0200
Subject: [PATCH] fix on disappearing title when removing appointment from
 daily planning

---
 smash/web/static/js/daily_planning.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/smash/web/static/js/daily_planning.js b/smash/web/static/js/daily_planning.js
index 798ca84b..ec43541e 100644
--- a/smash/web/static/js/daily_planning.js
+++ b/smash/web/static/js/daily_planning.js
@@ -42,10 +42,14 @@ function add_event(event, color, subjectId, boxBody) {
         location = event.flying_team_location + ' (FT)';
         borderColor = FLYING_TEAM_BORDER_COLOR;
     }
+    var event_title = event.short_title;
+    if (event_title === undefined || event_title === "") {
+        event_title = event.title;
+    }
     eventElement.data('event', {
         appointment_start: event.appointment_start,
         appointment_end: event.appointment_end,
-        title: event.short_title,
+        title: event_title,
         stick: true,
         color: color + " !important",
         duration: event.duration,
@@ -117,6 +121,7 @@ function get_subjects_events(day) {
             boxHeader.append(title_subject);
             $.each(subject.events, function (index_event, event) {
                 if (event.link_when) {
+                    event.title = event.short_title;
                     event.color = subject.color + ' !important';
                     event.start = $.fullCalendar.moment(event.link_when);
                     event.end = $.fullCalendar.moment(event.link_end);
-- 
GitLab