OSD select sort (#3287)

master
HThuren 2023-01-30 20:40:54 +01:00 committed by GitHub
parent bdd87a5d54
commit 4f6fcb0d3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -2774,6 +2774,8 @@ osd.initialize = function(callback) {
const timerSourceOptionText = i18n.getMessage(`osdTimerSourceOption${inflection.camelize(e.toLowerCase())}`);
src.append(`<option value="${i}">${timerSourceOptionText}</option>`);
});
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
src.sortSelect();
src[0].selectedIndex = tim.src;
src.blur(function() {
const idx = $(this)[0].id.split("_")[1];
@ -2795,6 +2797,8 @@ osd.initialize = function(callback) {
const timerPrecisionOptionText = i18n.getMessage(`osdTimerPrecisionOption${inflection.camelize(e.toLowerCase())}`);
precision.append(`<option value="${i}">${timerPrecisionOptionText}</option>`);
});
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
precision.sortSelect();
precision[0].selectedIndex = tim.precision;
precision.blur(function() {
const idx = $(this)[0].id.split("_")[1];
@ -3068,6 +3072,9 @@ osd.initialize = function(callback) {
.html(i18n.getMessage(variantText)));
}
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
selectVariant.sortSelect();
selectVariant.val(field.variant);
$labelAndVariant.append(selectVariant);