mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-13 19:40:22 +03:00
cleaning
This commit is contained in:
parent
725e062479
commit
1b4c729e46
6 changed files with 72 additions and 328 deletions
21
js/gui.js
21
js/gui.js
|
@ -355,5 +355,26 @@ GUI_control.prototype.updateProfileChange = function() {
|
|||
$('#profilechange').val(CONFIG.profile);
|
||||
};
|
||||
|
||||
GUI_control.prototype.fillSelect = function ($element, values, currentValue, unit) {
|
||||
if (unit == null) {
|
||||
unit = '';
|
||||
}
|
||||
|
||||
$element.find("*").remove();
|
||||
|
||||
for (var i in values) {
|
||||
if (values.hasOwnProperty(i)) {
|
||||
$element.append('<option value="' + i + '">' + values[i] + '</option>');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If current Value is not on the list, add a new entry
|
||||
*/
|
||||
if (currentValue != null && $element.find('[value="' + currentValue + '"]').length == 0) {
|
||||
$element.append('<option value="' + currentValue + '">' + currentValue + unit + '</option>');
|
||||
}
|
||||
};
|
||||
|
||||
// initialize object into GUI variable
|
||||
var GUI = new GUI_control();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue