mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-14 20:10:11 +03:00
Merge branch 'iNavFlight:master' into strobe-configurator
This commit is contained in:
commit
e567dce178
4 changed files with 26 additions and 7 deletions
5
js/fc.js
5
js/fc.js
|
@ -1239,7 +1239,10 @@ var FC = {
|
|||
7: "Horizon",
|
||||
8: "Air",
|
||||
9: "USER 1",
|
||||
10: "USER 2"
|
||||
10: "USER 2",
|
||||
11: "Course Hold",
|
||||
12: "USER 3",
|
||||
13: "USER 4",
|
||||
}
|
||||
},
|
||||
4: {
|
||||
|
|
22
js/gui.js
22
js/gui.js
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue