mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-14 03:49:53 +03:00
Merge branch 'master' into advanced-tuning-tab
This commit is contained in:
commit
fea2505fde
6 changed files with 113 additions and 3 deletions
18
js/gui.js
18
js/gui.js
|
@ -221,5 +221,23 @@ GUI_control.prototype.fillSelect = function ($element, values, currentValue, uni
|
|||
}
|
||||
};
|
||||
|
||||
GUI_control.prototype.simpleBind = function () {
|
||||
$('input[data-simple-bind]').not('[data-simple-binded="true"]').each(function () {
|
||||
var $this = $(this),
|
||||
toBind = $this.data('simple-bind').split(".");
|
||||
|
||||
if (toBind.length !== 2 || window[toBind[0]][toBind[1]] === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this.change(function () {
|
||||
window[toBind[0]][toBind[1]] = $(this).val();
|
||||
});
|
||||
|
||||
$this.val(window[toBind[0]][toBind[1]]);
|
||||
$this.attr('data-simple-binded', true);
|
||||
});
|
||||
};
|
||||
|
||||
// initialize object into GUI variable
|
||||
var GUI = new GUI_control();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue