CC-3285 : show over booked error message

checking if percentage is over 100.
This commit is contained in:
Naomi Aro 2012-02-08 15:13:17 +01:00
parent 1080bf692f
commit c23491b257
3 changed files with 89 additions and 23 deletions

View file

@ -11,11 +11,10 @@ function closeDialog(event, ui) {
$(this).remove();
}
function checkShowLength() {
var showFilled = $("#show_time_filled").text().split('.')[0];
var showLength = $("#show_length").text();
function checkShowLength(json) {
var percent = json.percentFilled;
if (showFilled > showLength){
if (percent > 100){
$("#show_time_warning")
.text("Shows longer than their scheduled time will be cut off by a following show.")
.show();
@ -41,7 +40,7 @@ function setScheduleDialogHtml(json) {
$("#show_time_filled").empty().append(json.timeFilled);
$("#show_progressbar").progressbar( "value" , json.percentFilled );
checkShowLength();
checkShowLength(json);
}
function setScheduleDialogEvents(dialog) {
@ -298,7 +297,7 @@ function buildScheduleDialog(json){
});
dialog.dialog('open');
checkShowLength();
checkShowLength(json);
}