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

Merge pull request #2163 from McGiverGim/order_blackbox_debug

Add search and order to the blackbox debug modes list
This commit is contained in:
Michael Keller 2020-09-01 00:40:48 +12:00 committed by GitHub
commit 1e583080a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -358,6 +358,22 @@ TABS.onboard_logging.initialize = function (callback) {
}
debugModeSelect.val(FC.PID_ADVANCED_CONFIG.debugMode);
// Convert to select2 and order alphabetic
debugModeSelect.select2({
sorter(data) {
return data.sort(function(a, b) {
if (a.text === "NONE" || b.text === i18n.getMessage('onboardLoggingDebugModeUnknown')) {
return -1;
} else if (b.text ==="NONE" || a.text === i18n.getMessage('onboardLoggingDebugModeUnknown')) {
return 1;
} else {
return a.text.localeCompare(b.text);
}
});
},
});
} else {
$('.blackboxDebugMode').hide();
}