1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-16 12:55:13 +03:00

Add ordering to Serial Rx Providers

Sorts Rx providers alphabetically.
This commit is contained in:
Darren Lines 2023-01-17 11:50:58 +00:00
parent 6bc27d22f3
commit 5388a12370

View file

@ -79,6 +79,21 @@ TABS.receiver.initialize = function (callback) {
let $receiverMode = $('#receiver_type'),
$serialWrapper = $('#serialrx_provider-wrapper');
// Order Serial Rx providers
let serialRxProviders = $('#serialrx_provider option');
let selectedRxProvider = $('#serialrx_provider').val();
serialRxProviders.sort(function(a,b) {
if (a.text > b.text) {
return 1;
} else if (a.text < b.text) {
return -1;
} else {
return 0;
}
});
$("#serialrx_provider").empty().append(serialRxProviders);
$('#serialrx_provider').val(selectedRxProvider);
$receiverMode.change(function () {
if ($(this).find("option:selected").text() == "SERIAL") {
$serialWrapper.show();