From 3e60713590aa88e91e98bb06bb3f0a55ebc66389 Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 20 Jul 2015 15:20:50 -0400 Subject: [PATCH] SAAS-962: "Now" option should not be available for linked shows Also added fix for SAAS-957 --- .../public/js/airtime/schedule/add-show.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index f6b359953..3e3ceec0b 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -64,14 +64,14 @@ function setupStartTimeWidgets() { $('#add_show_end_date_no_repeat').val(nowShowEnd.format('YYYY-MM-DD')); $('#add_show_end_time').val(nowShowEnd.format('HH:mm')); - } else { - //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'); - } + //Disabled linked show option since user won't be able to schedule + //content + $('#add_show_linked').prop('disabled', 'true'); - if (!$('#add_show_start_time').prop('disabled')) { + } else { + //Do not enable start date and time option when a show has already started + if (!$('#add_show_start_now-now').prop('disabled')) { + $('#add_show_start_date').removeProp('disabled'); $('#add_show_start_time').removeProp('disabled'); } @@ -248,6 +248,10 @@ function setAddShowEvents(form) { form.find('input:radio[name=add_show_start_now]').click(function() { setupStartTimeWidgets(); + + if ($(this).val() == "future") { + $('#add_show_linked').removeProp('disabled'); + } });