From 73e5fa8a9038e11faa159f045e37a8d59e99065d Mon Sep 17 00:00:00 2001 From: Naomi Date: Fri, 11 Oct 2013 18:15:12 -0400 Subject: [PATCH] CC-5410 : Now playing icon should not lag to show up on calendar --- airtime_mvc/application/models/Show.php | 8 ++++++++ .../airtime/schedule/full-calendar-functions.js | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index f5cac2aa0..bfcd9edd0 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1082,6 +1082,14 @@ SQL; $event["rebroadcast"] = intval($show["rebroadcast"]); $event["soundcloud_id"] = is_null($show["soundcloud_id"]) ? -1 : $show["soundcloud_id"]; + + //for putting the now playing icon on the show. + if ($now > $startsDT && $now < $endsDT) { + $event["nowPlaying"] = true; + } + else { + $event["nowPlaying"] = false; + } //event colouring if ($show["color"] != "") { diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js index 6f67364a2..053df0362 100644 --- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js +++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js @@ -288,6 +288,21 @@ function eventRender(event, element, view) { $(element).find(".fc-event-title").after(''); } } + + //now playing icon. + var span = ''; + + if (event.nowPlaying === true) { + + if (view_name === 'agendaDay' || view_name === 'agendaWeek') { + + $(element).find(".fc-event-time").before(span); + } + else if (view_name === 'month') { + + $(element).find(".fc-event-title").after(span); + } + } } function eventAfterRender( event, element, view ) {