mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-17 05:15:20 +03:00
Add ordering to Serial Rx Providers
Sorts Rx providers alphabetically.
This commit is contained in:
parent
6bc27d22f3
commit
5388a12370
1 changed files with 15 additions and 0 deletions
|
@ -79,6 +79,21 @@ TABS.receiver.initialize = function (callback) {
|
||||||
let $receiverMode = $('#receiver_type'),
|
let $receiverMode = $('#receiver_type'),
|
||||||
$serialWrapper = $('#serialrx_provider-wrapper');
|
$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 () {
|
$receiverMode.change(function () {
|
||||||
if ($(this).find("option:selected").text() == "SERIAL") {
|
if ($(this).find("option:selected").text() == "SERIAL") {
|
||||||
$serialWrapper.show();
|
$serialWrapper.show();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue