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

Added handing for selected LCs that are now disabled

This commit is contained in:
Darren Lines 2022-08-13 20:38:13 +01:00
parent b8485457dd
commit daa70fc4b1
2 changed files with 15 additions and 2 deletions

View file

@ -304,13 +304,22 @@ GUI_control.prototype.renderLogicConditionSelect = function ($container, logicCo
let $select = $container.append('<select class="mix-rule-condition">').find("select"), let $select = $container.append('<select class="mix-rule-condition">').find("select"),
lcCount = logicConditions.getCount(); lcCount = logicConditions.getCount();
option = "";
if (withAlways) { if (withAlways) {
$select.append('<option value="-1">Always</option>') $select.append('<option value="-1">Always</option>')
} }
for (let i = 0; i < lcCount ; i++) { for (let i = 0; i < lcCount ; i++) {
if (!onlyEnabled || (logicConditions.isEnabled(i))) { if (!onlyEnabled || i === current || (logicConditions.isEnabled(i))) {
$select.append('<option value="' + i + '">Logic Condition ' + i + ' </option>'); option = '<option';
if (i === current && !logicConditions.isEnabled(i)) {
option+= ' class="lc_disabled"';
}
option+= ' value="' + i + '">Logic Condition ' + i + ' </option>';
$select.append(option);
} }
} }

View file

@ -2010,6 +2010,10 @@ select {
padding: 1px; padding: 1px;
} }
.lc_disabled {
color: #aaa;
}
.ic_osd { .ic_osd {
background-image: url("../images/icons/icon_osd.svg"); background-image: url("../images/icons/icon_osd.svg");
background-position-y: 4px; background-position-y: 4px;