mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-24 16:55:24 +03:00
Merge pull request #2575 from Asizon/convert_serial_protocols_select2
Convert serial rx and Spi rx protocols selectors to Select2
This commit is contained in:
commit
88b7c9a4d9
1 changed files with 22 additions and 0 deletions
|
@ -259,6 +259,17 @@ TABS.receiver.initialize = function (callback) {
|
|||
// select current serial RX type
|
||||
serialRxSelectElement.val(FC.RX_CONFIG.serialrx_provider);
|
||||
|
||||
// Convert to select2 and order alphabetic
|
||||
if (!GUI.isCordova()) {
|
||||
serialRxSelectElement.select2({
|
||||
sorter(data) {
|
||||
return data.sort(function(a, b) {
|
||||
return a.text.localeCompare(b.text);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_31)) {
|
||||
const spiRxTypes = [
|
||||
'NRF24_V202_250K',
|
||||
|
@ -322,6 +333,17 @@ TABS.receiver.initialize = function (callback) {
|
|||
|
||||
// select current serial RX type
|
||||
spiRxElement.val(FC.RX_CONFIG.rxSpiProtocol);
|
||||
|
||||
if (!GUI.isCordova()) {
|
||||
// Convert to select2 and order alphabetic
|
||||
spiRxElement.select2({
|
||||
sorter(data) {
|
||||
return data.sort(function(a, b) {
|
||||
return a.text.localeCompare(b.text);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue