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

Merge branch 'master' into MrD_Changes-for-PR-8401

This commit is contained in:
Darren Lines 2022-10-01 14:24:41 +01:00 committed by GitHub
commit 91da0f642b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
139 changed files with 449 additions and 107 deletions

View file

@ -316,16 +316,27 @@ GUI_control.prototype.renderOperandValue = function ($container, operandMetadata
* @param {function} onChange
* @param {boolean} withAlways
*/
GUI_control.prototype.renderLogicConditionSelect = function ($container, logicConditions, current, onChange, withAlways) {
GUI_control.prototype.renderLogicConditionSelect = function ($container, logicConditions, current, onChange, withAlways, onlyEnabled) {
let $select = $container.append('<select class="mix-rule-condition">').find("select"),
lcCount = logicConditions.getCount();
option = "";
if (withAlways) {
$select.append('<option value="-1">Always</option>')
}
for (let i = 0; i < lcCount ; i++) {
$select.append('<option value="' + i + '">Logic Condition ' + i + ' </option>');
if (!onlyEnabled || i === current || (logicConditions.isEnabled(i))) {
option = '<option';
if (i === current && !logicConditions.isEnabled(i)) {
option+= ' class="lc_disabled"';
}
option+= ' value="' + i + '">Logic Condition ' + i + ' </option>';
$select.append(option);
}
}
$select.val(current).change(onChange);