Also calc distance and bearing while editing VUCC grids

This commit is contained in:
phl0
2024-04-27 22:50:02 +02:00
parent 4638f810c8
commit 356c89c0fd

View File

@@ -252,6 +252,42 @@ function qso_edit(id) {
}
});
$('#vucc_grids').change(function(){
if ($(this).val().length >= 9) {
$.ajax({
url: base_url + 'index.php/logbook/searchbearing',
type: 'post',
data: {
grid: $(this).val(),
stationProfile: $('#stationProfile').val()
},
success: function(data) {
$('#locator_info').html(data).fadeIn("slow");
},
error: function() {
$('#locator_info').text("Error loading bearing!").fadeIn("slow");
},
});
$.ajax({
url: base_url + 'index.php/logbook/searchdistance',
type: 'post',
data: {
grid: $(this).val(),
stationProfile: $('#stationProfile').val()
},
success: function(data) {
document.getElementById("distance").value = data;
},
error: function() {
document.getElementById("distance").value = null;
},
});
} else if ($(this).val().length == 0) {
$('#locator_info').fadeOut("slow");
document.getElementById("distance").value = null;
}
});
$('#sota_ref_edit').selectize({
maxItems: 1,
closeAfterSelect: true,