diff --git a/src/js/tabs/onboard_logging.js b/src/js/tabs/onboard_logging.js index 8355e8d3..18880237 100644 --- a/src/js/tabs/onboard_logging.js +++ b/src/js/tabs/onboard_logging.js @@ -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(); }