Skip to content

Commit

Permalink
Merge pull request #15 from larsyngvelundin/12-css-match-list-with-fo…
Browse files Browse the repository at this point in the history
…rm-builder-list

12 css match list with form builder list
  • Loading branch information
larsyngvelundin authored Mar 23, 2024
2 parents 5531db5 + ab4bb6e commit df8c66e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
16 changes: 15 additions & 1 deletion modules/helpFunctions/addCss.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,21 @@ function addCss() {
text-align: left;
border: 1px solid #d3d3d3;
}
#conditionListElement > ul{
padding-inline-start: 0px;
margin-block-start: 0px;
margin-block-end: 0px;
}
#conditionListBar {
padding: 10px;
cursor: move;
z-index: 10;
background-color: #2196F3;
color: #fff;
}
.collapsible{
vertical-align: top;
Expand All @@ -43,6 +50,13 @@ function addCss() {
display:none;
}
.conditionListEntry{
padding: 5px;
font-size: 14px;
line-height: 1.618em;
list-style: none;
}
`;
document.body.appendChild(ConditionListStyles);
}
7 changes: 5 additions & 2 deletions modules/list/getConditionLi.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
function getConditionLi(condition, iCon) {
var conditionLi = document.createElement("li");
// conditionLi.innerHTML = condition.id;
// conditionLi.innerHTML = "";
conditionLi.classList.add("conditionListEntry");
var innerHTML = `<button type="button" style="display:inline-block;" class="collapsible">v</button>`;
innerHTML += `<div class="content" style="display:inline-block;">`;
innerHTML += `<div class="termDiv" style="display:block;">`;
for (let iTer = 0; iTer < condition.terms.length; iTer++) {
var term = condition.terms[iTer];
innerHTML += `<div>`;
innerHTML += `<span id="${iCon}-${iTer}" class="conditionTermResult"></span>`;
innerHTML += `<b>IF</b> ${getFieldLabel(term.field)} <b>${operatorObj[term.operator]}</b>${resultOfTerm(term)}`;
innerHTML += `</div>`;
}
innerHTML += "</div>"
innerHTML += `<div class="actionDiv" style="display:block;">`;
for (let iAct = 0; iAct < condition.action.length; iAct++) {
var action = condition.action[iAct];
console.log(action);
Expand All @@ -34,6 +36,7 @@ function getConditionLi(condition, iCon) {
}
}
innerHTML += "</div>"
innerHTML += "</div>"
conditionLi.innerHTML = innerHTML;
return conditionLi;
}

0 comments on commit df8c66e

Please sign in to comment.