Skip to content

Commit 45dac7c

Browse files
committed
use-select2
1 parent 84a0d6b commit 45dac7c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/css/tabs/onboard_logging.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@
225225
line-height: 20px;
226226
}
227227
}
228+
.blackboxDebugModeText {
229+
margin-left: 7px !important;
230+
}
228231
.sdcard {
229232
padding: 10px;
230233
float: left;

src/js/tabs/onboard_logging.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,22 @@ onboard_logging.initialize = function (callback) {
340340
}
341341

342342
debugModeSelect.val(FC.PID_ADVANCED_CONFIG.debugMode);
343-
debugModeSelect.sortSelect("NONE");
343+
344+
// Convert to select2 and order alphabetic
345+
debugModeSelect.select2({
346+
sorter(data) {
347+
return data.sort(function(a, b) {
348+
if (a.text === "NONE" || b.text === i18n.getMessage('onboardLoggingDebugModeUnknown')) {
349+
return -1;
350+
} else if (b.text ==="NONE" || a.text === i18n.getMessage('onboardLoggingDebugModeUnknown')) {
351+
return 1;
352+
} else {
353+
return a.text.localeCompare(b.text);
354+
}
355+
});
356+
},
357+
});
358+
// debugModeSelect.sortSelect("NONE");
344359

345360
} else {
346361
$('.blackboxDebugMode').hide();

0 commit comments

Comments
 (0)