1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 08:45:26 +03:00

Unified LogicConditions selector

This commit is contained in:
Pawel Spychalski (DzikuVx) 2020-04-14 11:55:23 +02:00
parent dd551f5ecb
commit c005214a2b
3 changed files with 39 additions and 24 deletions

View file

@ -165,21 +165,13 @@ let GlobalFunction = function (enabled, conditionId, action, operandType, operan
self.renderLogicId = function($row) {
if (self.getEnabled()) {
$row.find('.function_cell__logicId').html("<select class='function__logicId' ></select>");
let $t = $row.find(".function__logicId");
let count = LOGIC_CONDITIONS.getCount();
console.log(self.getConditionId());
for (let i = 0; i < count ; i++) {
if (i == self.getConditionId()) {
$t.append('<option value="' + i + '" selected>Logic Condition ' + i + ' </option>');
} else {
$t.append('<option value="' + i + '">Logic Condition ' + i + ' </option>');
}
}
$t.change(self.onLogicIdChange);
GUI.renderLogicConditionSelect(
$row.find('.function_cell__logicId'),
LOGIC_CONDITIONS,
self.getConditionId(),
self.onLogicIdChange,
true
);
} else {
$row.find('.function_cell__logicId').html("");
}