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

Add search and order to the blackbox debug modes list

This commit is contained in:
Miguel Angel Mulero Martinez 2020-08-26 16:08:17 +02:00
parent 6370a0153c
commit 062017b0a6

View file

@ -353,6 +353,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();
}