set active location on change in simplefle aswell

This commit is contained in:
HB9HIL
2024-05-31 17:19:28 +02:00
parent 240e50f2fd
commit 2b5b41a25a
3 changed files with 13 additions and 11 deletions

View File

@@ -79,10 +79,10 @@
<div class="row">
<div class="col-xs-12 col-lg-6">
<div class="mb-3">
<label for="station-call">
<label for="stationProfile">
<?php echo lang('qso_simplefle_station_call_location'); ?>
</label>
<select name="station_profile" class="station_id form-select" id="station-call">
<select name="station_profile" class="station_id form-select" id="stationProfile">
<?php foreach ($station_profile->result() as $station) { ?>
<option value="<?php echo $station->station_id; ?>" <?php if ($station->station_id == $this->stations->find_active()) {
echo 'selected';

View File

@@ -897,8 +897,10 @@ function set_active_loc_quickswitcher(new_active) {
reloadStations();
}
// If the user is in the QSO view we change the station in the QSO input aswell
if (window.location.pathname.indexOf("qso") !== -1) {
// If the user is in the QSO or SimpleFLE view we change the station in the QSO input aswell
if (window.location.pathname.indexOf("qso") !== -1 ||
window.location.pathname.indexOf("simplefle") !== -1) {
if ($('#stationProfile option[value="' + new_active + '"]').length > 0) {
$('#stationProfile').val(new_active);
}

View File

@@ -23,7 +23,7 @@ $(document).ready(function () {
var myGrid = localStorage.getItem(`user_${user_id}_my-grid`);
if (mycall != null) {
$("#station-call").val(mycall);
$("#stationProfile").val(mycall);
}
if (operator != null) {
@@ -213,7 +213,7 @@ function handleInput() {
var operator = $("#operator").val();
operator = operator.toUpperCase();
var ownCallsign = $("#station-call").val().toUpperCase();
var ownCallsign = $("#stationProfile").val().toUpperCase();
ownCallsign = ownCallsign.toUpperCase();
var extraQsoDate = qsodate;
@@ -384,7 +384,7 @@ function handleInput() {
);
localStorage.setItem(
`user_${user_id}_my-call`,
$("#station-call").val()
$("#stationProfile").val()
);
localStorage.setItem(
`user_${user_id}_operator`,
@@ -443,12 +443,12 @@ function handleInput() {
}
function checkMainFieldsErrors() {
if ($("#station-call").val() === "-") {
if ($("#stationProfile").val() === "-") {
$("#warningStationCall").show();
$("#station-call").css("border", "2px solid rgb(217, 83, 79)");
$("#stationProfile").css("border", "2px solid rgb(217, 83, 79)");
$("#warningStationCall").text(lang_qso_simplefle_error_stationcall);
} else {
$("#station-call").css("border", "");
$("#stationProfile").css("border", "");
$("#warningStationCall").hide();
}
@@ -912,7 +912,7 @@ $(".js-save-to-log").click(function () {
if (result) {
var operator = $("#operator").val();
operator = operator.toUpperCase();
var ownCallsign = $("#station-call").val().toUpperCase();
var ownCallsign = $("#stationProfile").val().toUpperCase();
ownCallsign = ownCallsign.toUpperCase();
// var mySotaWwff = $("#my-sota-wwff").val().toUpperCase();