1
0
Fork 0
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:
Pawel Spychalski (DzikuVx) 2017-01-23 22:30:32 +01:00
commit fea2505fde
6 changed files with 113 additions and 3 deletions

View file

@ -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();