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

Tab adjustments: Sort the translated optionlist (#3152)

* Sort the translated optionlist

* Remoove 22_2 and 23_2

* Remove 22_2 and 23_2 in messages

* Now use sortSelect in common.js
This commit is contained in:
HThuren 2022-12-28 14:13:09 +01:00 committed by GitHub
parent 1f7e77938c
commit 704970e291
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 20 deletions

View file

@ -287,26 +287,15 @@ adjustments.cleanup = function (callback) {
};
adjustments.adjust_template = function () {
const selectFunction = $('#functionSelectionSelect');
const elementsNumber = 31; // OSD Profile Select & LED Profile Select
const elementsNumber = 31; // 'LED Profile Select' are the last adjustmentsFunction
for (let i = 0; i < elementsNumber; i++) {
selectFunction.append(new Option(i18n.getMessage(`adjustmentsFunction${i}`), i));
}
// For 1.40, the D Setpoint has been replaced, so we replace it with the correct values
const element22 = selectFunction.find("option[value='22']");
const element23 = selectFunction.find("option[value='23']");
// Change the "text"
element22.text(i18n.getMessage('adjustmentsFunction22_2'));
element23.text(i18n.getMessage('adjustmentsFunction23_2'));
// Reorder, we insert it with the other FF elements to be coherent...
element22.insertAfter(selectFunction.find("option[value='25']"));
element23.insertAfter(selectFunction.find("option[value='28']"));
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
selectFunction.sortSelect(i18n.getMessage("adjustmentsFunction0"));
};
window.TABS.adjustments = adjustments;