diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index 74576fa16..1df5b1c6a 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -426,10 +426,12 @@ $(document).ready(function() { $(window).resize(function(){ var windowWidth = $(this).width(); // margin on showform are 16 px on each side - var calendarWidth = 100-(($("#schedule-add-show").width() + (16 * 6))/windowWidth*100); - var widthPercent = parseInt(calendarWidth)+"%"; - $("#schedule_calendar").css("width", widthPercent); - $("#schedule_calendar").fullCalendar('render'); + if(!$("#schedule-add-show").is(':hidden')){ + var calendarWidth = 100-(($("#schedule-add-show").width() + (16 * 4))/windowWidth*100); + var widthPercent = parseInt(calendarWidth)+"%"; + $("#schedule_calendar").css("width", widthPercent); + $("#schedule_calendar").fullCalendar('render'); + } }); $(window).load(function() { 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 720fc2d2e..e0de9e0ac 100644 --- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js +++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js @@ -15,7 +15,7 @@ function openAddShowForm() { $("#add-show-form").show(); var windowWidth = $(window).width(); // margin on showform are 16 px on each side - var calendarWidth = 100-(($("#schedule-add-show").width() + (16 * 6))/windowWidth*100); + var calendarWidth = 100-(($("#schedule-add-show").width() + (16 * 4))/windowWidth*100); var widthPercent = parseInt(calendarWidth)+"%"; $("#schedule_calendar").css("width", widthPercent); $("#schedule_calendar").fullCalendar('render');