diff options
author | Pawel Spychalski (DzikuVx) <pspychalski@gmail.com> | 2019-03-10 17:14:31 +0300 |
---|---|---|
committer | Pawel Spychalski (DzikuVx) <pspychalski@gmail.com> | 2019-03-10 17:14:31 +0300 |
commit | 2946fe5c2a2c4e183078330d23bea2260422c5ac (patch) | |
tree | d40a89438101bb926ff15d78b6c9f90798bbda37 | |
parent | 3e1e38f6d290d752518b249f29473daf48f805fb (diff) |
Render basic table
-rw-r--r-- | js/logicCondition.js | 15 | ||||
-rw-r--r-- | js/logicConditionsCollection.js | 10 | ||||
-rw-r--r-- | tabs/mixer.html | 2 | ||||
-rw-r--r-- | tabs/mixer.js | 3 |
4 files changed, 29 insertions, 1 deletions
diff --git a/js/logicCondition.js b/js/logicCondition.js index 93a51101..57651f76 100644 --- a/js/logicCondition.js +++ b/js/logicCondition.js @@ -59,5 +59,20 @@ let LogicCondition = function (enabled, operation, operandAType, operandAValue, flags = data; }; + + self.render = function ($container) { + + $container.find('tbody').append('<tr>\ + <td class="logic_cell__index"></td>\ + <td class="logic_cell__enabled"></td>\ + <td class="logic_cell__operation"></td>\ + <td class="logic_cell__operandA"></td>\ + <td class="logic_cell__operandB"></td>\ + <td class="logic_cell__flags"></td>\ + </tr>\ + '); + + } + return self; };
\ No newline at end of file diff --git a/js/logicConditionsCollection.js b/js/logicConditionsCollection.js index a94c67d0..73d47527 100644 --- a/js/logicConditionsCollection.js +++ b/js/logicConditionsCollection.js @@ -21,5 +21,15 @@ let LogicConditionsCollection = function () { return data.length } + self.render = function ($container) { + + for (let k in self.get()) { + if (self.get().hasOwnProperty(k)) { + self.get()[k].render($container); + } + } + + } + return self; };
\ No newline at end of file diff --git a/tabs/mixer.html b/tabs/mixer.html index e6ad82eb..16f25c5a 100644 --- a/tabs/mixer.html +++ b/tabs/mixer.html @@ -130,7 +130,7 @@ <div id="logic-background" class="logic__background"></div> <div id="logic-content" class="logic__content"> <div class="tab_title" data-i18n="tabLogicConditions"></div> - <table id="servo-mix-table" class="mixer-table"> + <table id="logic-table" class="mixer-table"> <thead> <tr> <th style="width: 75px" data-i18n="logicId"></th> diff --git a/tabs/mixer.js b/tabs/mixer.js index ffcf3023..49c5dee9 100644 --- a/tabs/mixer.js +++ b/tabs/mixer.js @@ -378,6 +378,9 @@ TABS.mixer.initialize = function (callback, scrollPosition) { renderOutputMapping(); localize(); + + LOGIC_CONDITIONS.render($('#logic-table')); + GUI.content_ready(callback); } |