diff --git a/public/js/airtime/schedule/add-show.js b/public/js/airtime/schedule/add-show.js
index d0fb0e2b2..0afe6f753 100644
--- a/public/js/airtime/schedule/add-show.js
+++ b/public/js/airtime/schedule/add-show.js
@@ -123,6 +123,9 @@ function setAddShowEvents() {
$("#schedule_calendar").width(y+z+50);
$("#schedule_calendar").fullCalendar('render');
$("#add-show-form").hide();
+
+ //in full-calendar-functions.js
+ makeAddShowButton();
});
$("#add-show-submit")
diff --git a/public/js/airtime/schedule/full-calendar-functions.js b/public/js/airtime/schedule/full-calendar-functions.js
index d5e0e5926..c547602a0 100644
--- a/public/js/airtime/schedule/full-calendar-functions.js
+++ b/public/js/airtime/schedule/full-calendar-functions.js
@@ -4,6 +4,21 @@
*
*/
+function makeAddShowButton(){
+ $('.fc-header-left tbody tr:first')
+ .append('
| ')
+ .append('Show | ')
+ .find('td:last > a')
+ .click(function(){
+ $("#add-show-form").show();
+ var y = $("#schedule_calendar").width();
+ var z = $("#schedule-add-show").width();
+ $("#schedule_calendar").width(y-z-50);
+ $("#schedule_calendar").fullCalendar('render');
+ $(this).remove();
+ });
+}
+
function makeTimeStamp(date){
var sy, sm, sd, h, m, s, timestamp;
sy = date.getFullYear();
@@ -54,17 +69,7 @@ function viewDisplay( view ) {
}
if($("#add-show-form").length == 1 && $('.fc-header-left tbody td').length === 5) {
- $('.fc-header-left tbody tr:first')
- .append(' | ')
- .append('Show | ')
- .find('td:last > a')
- .click(function(){
- $("#add-show-form").show();
- var y = $("#schedule_calendar").width();
- var z = $("#schedule-add-show").width();
- $("#schedule_calendar").width(y-z-50);
- $("#schedule_calendar").fullCalendar('render');
- });
+ makeAddShowButton();
}
}