From a6854ea507983fed7f810b616b02961edc60c424 Mon Sep 17 00:00:00 2001 From: drigato Date: Fri, 17 Jul 2015 16:28:33 -0400 Subject: [PATCH] SAAS-957: Error on "update show" --- airtime_mvc/public/js/airtime/schedule/add-show.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index 36910bdd5..f6b359953 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -48,7 +48,6 @@ function toggleAddShowButton(){ } function setupStartTimeWidgets() { - if ($('input[name=add_show_start_now]:checked').val() == 'now') { $('#add_show_start_date').prop('disabled', 'true'); $('#add_show_start_time').prop('disabled', 'true'); @@ -66,8 +65,16 @@ function setupStartTimeWidgets() { $('#add_show_end_time').val(nowShowEnd.format('HH:mm')); } else { - $('#add_show_start_date').removeProp('disabled'); - $('#add_show_start_time').removeProp('disabled'); + //Prevent enabling of elements that should always be disabled. + //i.e. when editing a show that has already started + if (!$('#add_show_start_date').prop('disabled')) { + $('#add_show_start_date').removeProp('disabled'); + } + + if (!$('#add_show_start_time').prop('disabled')) { + $('#add_show_start_time').removeProp('disabled'); + } + } }