From 4241e8341e0f9d0fa326741840d97613482086bb Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 31 Mar 2011 14:33:47 -0400 Subject: [PATCH] CC-2087: Pressing twice on "add this show" creates two instances of the show -Fixed on the client side only. Possibly create a ticket for next release to implement table locking on server side. --- public/js/airtime/schedule/add-show.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/js/airtime/schedule/add-show.js b/public/js/airtime/schedule/add-show.js index 0299754ce..480530e7e 100644 --- a/public/js/airtime/schedule/add-show.js +++ b/public/js/airtime/schedule/add-show.js @@ -183,6 +183,13 @@ function setAddShowEvents() { form.find(".add-show-submit") .click(function(event){ + var addShowButton = $(this); + if (!addShowButton.hasClass("disabled")){ + addShowButton.addClass("disabled"); + } else { + return; + } + event.preventDefault(); var data = $("form").serializeArray(); @@ -203,6 +210,7 @@ function setAddShowEvents() { var end_date = $("#add_show_end_date").val(); $.post("/Schedule/add-show", {format: "json", data: data, hosts: hosts, days: days}, function(json){ + addShowButton.removeClass("disabled"); if(json.form) { $("#add-show-form") .empty()