1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-23 16:25:19 +03:00

Updated for PR 8401

Modes tab:
- Added USER 3 & USER 4 to modes ordering

Programming Tab:
- Added USER 3 & USER 4 to Flight Modes operand
- Added Course Hold to the Flight Modes operand. It was in firmware, but missing from Configurator
- Changed select operand values to order alphabetically. Looks much nicer than the random order.
This commit is contained in:
Darren Lines 2022-09-18 10:47:46 +01:00
parent 95376083c8
commit 47bf242ba7
3 changed files with 24 additions and 5 deletions

View file

@ -279,11 +279,27 @@ GUI_control.prototype.renderOperandValue = function ($container, operandMetadata
$t.append('<option value="' + i + '">' + i + '</option>');
}
} else if (operandMetadata.type == "dictionary") {
for (let k in operandMetadata.values) {
if (operandMetadata.values.hasOwnProperty(k)) {
$t.append('<option value="' + k + '">' + operandMetadata.values[k] + '</option>');
let operandValues = [];
for (let j in operandMetadata.values) {
if (operandMetadata.values.hasOwnProperty(j)) {
operandValues[parseInt(j,10)] = {
id: parseInt(j, 10),
name: operandMetadata.values[j],
};
}
}
operandValues.sort((a, b) => {
let ovAN = a.name.toLowerCase(),
ovBN = b.name.toLowerCase();
return (ovAN < ovBN) ? -1 : 1;
});
operandValues.forEach( val => {
$t.append('<option value="' + val.id + '">' + val.name + '</option>');
});
}
$t.val(value);