CC-2848: Misc bugs from demo service

- Handling concurrency issue playlist section and show(canlendar) section
This commit is contained in:
James 2011-11-10 15:35:27 -05:00
parent 17016e5d40
commit b04b7ff010
10 changed files with 317 additions and 72 deletions

View file

@ -60,6 +60,10 @@ function findHosts(request, callback) {
}
function beginEditShow(data){
if(data.show_error == true){
alertShowErrorAndReload();
return false;
}
$("#add-show-form")
.empty()
.append(data.newForm);
@ -310,7 +314,7 @@ function setAddShowEvents() {
.append(json.newForm);
setAddShowEvents();
scheduleRefetchEvents();
scheduleRefetchEvents(json);
}
});
});
@ -432,6 +436,14 @@ $(document).ready(function() {
//setAddShowEvents();
});
//Alert the error and reload the page
//this function is used to resolve concurrency issue
function alertShowErrorAndReload(){
alert("The show instance doesn't exist anymore!");
window.location.reload();
}
$(window).resize(function(){
var windowWidth = $(this).width();
// margin on showform are 16 px on each side