$('#distplot_bands').change(function(){ var band = $("#distplot_bands option:selected").text(); if (band != "SAT") { $("#distplot_sats").prop('disabled', true); $("#distplot_sats_container").hide(); } else { $("#distplot_sats").prop('disabled', false); $("#distplot_sats_container").show(); } }); // Auto-load chart on page load $(document).ready(function() { distPlot(); }); function distPlot() { $(".alert").remove(); // Show loading spinner $("#loading_spinner").removeClass('d-none'); $("#plot").prop('disabled', true); var baseURL= ""; $.ajax({ url: base_url+'index.php/distances/get_distances', type: 'post', data: { 'band': $("#distplot_bands").val(), 'sat': $("#distplot_sats").val(), 'mode': $("#distplot_modes").val(), 'pwr': $("#distplot_powers").val(), 'propag': $("#distplot_propag").val() }, success: function(tmp) { // Hide loading spinner $("#loading_spinner").addClass('d-none'); $("#plot").prop('disabled', false); if (tmp.ok == 'OK') { // Create containers if they don't exist if (!($('#stats_container').length > 0)) { $("#distances_div").append('
'); } if (!($('#graphcontainer').length > 0)) { $("#distances_div").append('