app/assets/javascripts/sales-console.js in artfully_ose-1.2.0.pre.27 vs app/assets/javascripts/sales-console.js in artfully_ose-1.2.0

- old
+ new

@@ -10,37 +10,42 @@ person_query_string = "" if (person_id != undefined) { person_query_string = "?person_id=" + person_id } - $('#show-select-container').show() - $('#show-select-controls').addClass("loading") - $('#show_selector').prop("disabled", true) - $('#ticket-list').html("&nbsp;"); - jQuery.getJSON("/console_sales/events/" + event_id + person_query_string, function(data){ - }) - .done(function(data) { - $('#show_selector') - .find('option') - .remove() - - $('#show-select-controls').removeClass("loading") + if( event_id ) { $('#show-select-container').show() + $('#show-select-controls').addClass("loading") + $('#show_selector').prop("disabled", true) + $('#ticket-list').html("&nbsp;"); - $('#show_selector').append($("<option></option>")) - - $.each(data, function(index, el) { - $('#show_selector') - .append($("<option></option>") - .attr("value",el.id) - .text(el.show_time)); + jQuery.getJSON("/console_sales/events/" + event_id + person_query_string, function(data){ }) + .done(function(data) { + $('#show_selector') + .find('option') + .remove() - $('#show_selector').prop("disabled", false) - }) - .fail(function() { - //TODO - }) + $('#show-select-controls').removeClass("loading") + $('#show-select-container').show() + + $('#show_selector').append($("<option></option>")) + + $.each(data, function(index, el) { + $('#show_selector') + .append($("<option></option>") + .attr("value",el.id) + .text(el.show_time)); + }) + + $('#show_selector').prop("disabled", false) + }) + .fail(function() { + //TODO + }) + } else { + $('#show-select-container').hide() + } }) $('#show-select-container').change(function () { show_id = $('#show_selector').val() person_id = $('#show_selector').attr('data-person-id') \ No newline at end of file