CC-3516: Creating a show has a long execution time

-grey out add-show form while busy
This commit is contained in:
Martin Konecny 2012-03-25 22:56:51 -04:00
parent a1d3f67b2e
commit 0525f182ef
3 changed files with 510 additions and 2 deletions

View file

@ -288,12 +288,14 @@ function setAddShowEvents() {
form.find(".add-show-submit")
.click(function(event){
var addShowButton = $(this);
/*
if (!addShowButton.hasClass("disabled")){
addShowButton.addClass("disabled");
}
else {
return;
}
*/
event.preventDefault();
@ -314,8 +316,13 @@ function setAddShowEvents() {
var start_date = $("#add_show_start_date").val();
var end_date = $("#add_show_end_date").val();
$('#schedule-add-show').block({
message: null
});
$.post("/Schedule/add-show", {format: "json", data: data, hosts: hosts, days: days}, function(json){
addShowButton.removeClass("disabled");
//addShowButton.removeClass("disabled");
$('#schedule-add-show').unblock();
if(json.form) {
$("#add-show-form")
.empty()
@ -331,6 +338,7 @@ function setAddShowEvents() {
$("#add-show-form")
.empty()
.append(json.newForm);
setAddShowEvents();
scheduleRefetchEvents(json);
@ -472,4 +480,4 @@ $(window).resize(function(){
$('#schedule_calendar').fullCalendar('option', 'contentHeight', mainHeight)
$("#schedule_calendar").fullCalendar('render');
});
});