From 2bbdb014955cddcd588ed120dba34678d6fa4453 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 11 Jan 2013 15:37:58 -0500 Subject: [PATCH] CC-4751: Calendar: Add/Remove contents won't trig status update of shows -fixed --- .../public/js/airtime/showbuilder/builder.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 365ee58fd..9526cd9f3 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -38,6 +38,28 @@ var AIRTIME = (function(AIRTIME){ mod.timestamp = timestamp; }; + + mod.updateCalendarStatusIcon = function(json) { + + if (window.location.pathname.toLowerCase() != "/schedule") { + return; + } + + var instance_id = json.schedule[0].instance; + + var lastElem = json.schedule[json.schedule.length-1]; + var $elem = $($(".fc-event-inner.fc-event-skin .fc-event-title#"+instance_id).parent()); + $elem.find(".small-icon").remove(); + if (json.schedule[1].empty) { + $elem + .find(".fc-event-title") + .after(''); + } else if (lastElem["fRuntime"][0] == "-") { + $elem + .find(".fc-event-title") + .after(''); + } + } mod.getTimestamp = function() { @@ -331,6 +353,7 @@ var AIRTIME = (function(AIRTIME){ "url": sSource, "data": aoData, "success": function(json) { + mod.updateCalendarStatusIcon(json) mod.setTimestamp(json.timestamp); mod.setShowInstances(json.instances); mod.getSelectedCursors();