Merge pull request #2575 from Asizon/convert_serial_protocols_select2

Convert serial rx and Spi rx protocols selectors to Select2
10.8-maintenance
haslinghuis 2021-10-13 22:24:16 +02:00 committed by GitHub
commit 88b7c9a4d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -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);
});
},
});
}
}