1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 14:25:14 +03:00

Update sort function (#3167)

This commit is contained in:
haslinghuis 2022-12-28 14:00:18 +01:00 committed by GitHub
parent 454627c05f
commit 1f7e77938c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 31 deletions

View file

@ -252,13 +252,7 @@ receiver.initialize = function (callback) {
// 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);
});
},
});
serialRxSelectElement.sortSelect().select2();
}
const spiRxTypes = [
@ -314,13 +308,7 @@ receiver.initialize = function (callback) {
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);
});
},
});
spiRxElement.sortSelect().select2();
}
if (FC.FEATURE_CONFIG.features.isEnabled('RX_SPI') && FC.RX_CONFIG.rxSpiProtocol == 19 && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_45)) {