From f80f409e0af3863bd3958274ad0ec19111c14b08 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Fri, 3 May 2024 18:29:45 +0200 Subject: [PATCH 1/2] change station in qso view aswell --- assets/js/sections/common.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 87cba790d..2676970e0 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -901,6 +901,13 @@ function set_active_loc_quickswitcher(new_active) { } }); }); + + // 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 ($('#stationProfile option[value="' + new_active + '"]').length > 0) { + $('#stationProfile').val(new_active); + } + } } From f6aec56593e95a4c0fabd2f7def2ebdaaaa5e3a6 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Fri, 3 May 2024 18:32:55 +0200 Subject: [PATCH 2/2] change only if ajax was successful --- assets/js/sections/common.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 2676970e0..017745cfb 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -895,19 +895,19 @@ function set_active_loc_quickswitcher(new_active) { if (typeof reloadStations === 'function') { 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 ($('#stationProfile option[value="' + new_active + '"]').length > 0) { + $('#stationProfile').val(new_active); + } + } }, error: function(xhr, status, error) { console.error('Error while setting the new active location: ' + error); } }); }); - - // 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 ($('#stationProfile option[value="' + new_active + '"]').length > 0) { - $('#stationProfile').val(new_active); - } - } }