Skip to content
Snippets Groups Projects
Commit 39b997bd authored by lowercasedonkey's avatar lowercasedonkey
Browse files

fixes

parent b48477ea
No related branches found
No related tags found
1 merge request!9370Make row titles in RA Summary sticky
...@@ -3,20 +3,17 @@ ...@@ -3,20 +3,17 @@
height: 90vh height: 90vh
} }
.ra-sum { table.ra-sum {
text-align: left; text-align: left;
border-collapse: separate; border-collapse: separate;
empty-cells: hide; empty-cells: hide;
border: 1px solid grey;
} }
.ra-sum:nth-child(even) { /*ra-sum:nth-child(even) {
background-color: #f2f2f2; background-color: #f2f2f2;
} }*/
td.ra-sum {
.ra-sum-cell { border: 1px solid grey;
border-style: solid;
border: 1px;
border-color: grey;
} }
tr.ra-sum.header { tr.ra-sum.header {
...@@ -24,6 +21,7 @@ tr.ra-sum.header { ...@@ -24,6 +21,7 @@ tr.ra-sum.header {
top:0px; top:0px;
z-index:2; z-index:2;
background:#111; background:#111;
border: inherit
} }
th.ra-sum.first-header-cell { th.ra-sum.first-header-cell {
......
...@@ -28,7 +28,7 @@ new App.DomPassage("Rules Assistant Summary", () => { ...@@ -28,7 +28,7 @@ new App.DomPassage("Rules Assistant Summary", () => {
/* make rest of row title */ /* make rest of row title */
for (const rule of rules) { for (const rule of rules) {
App.UI.DOM.appendNewElement("th", header, rule.name, "ra-sum-cell"); App.UI.DOM.appendNewElement("th", header, rule.name);
} }
const setters = rules.map(r => r.set); const setters = rules.map(r => r.set);
...@@ -87,12 +87,11 @@ new App.DomPassage("Rules Assistant Summary", () => { ...@@ -87,12 +87,11 @@ new App.DomPassage("Rules Assistant Summary", () => {
if (!cells.some(v => v !== null)) { // skip empty rows if (!cells.some(v => v !== null)) { // skip empty rows
return; return;
} }
const row = App.UI.DOM.makeElement("tr"); const row = App.UI.DOM.makeElement("tr", null, "ra-sum");
function ruleSetValueToString(v) { function ruleSetValueToString(v) {
if (typeof v === 'object') { if (typeof v === 'object') {
if (v.hasOwnProperty('cond') && v.hasOwnProperty('val')) { if (v.hasOwnProperty('cond') && v.hasOwnProperty('val')) {
console.log(v)
return `${v.cond} ${v.val}`; return `${v.cond} ${v.val}`;
} else if (v.hasOwnProperty('min') && v.hasOwnProperty('max')) { } else if (v.hasOwnProperty('min') && v.hasOwnProperty('max')) {
return `${v.min} to ${v.max}`; return `${v.min} to ${v.max}`;
...@@ -103,10 +102,10 @@ new App.DomPassage("Rules Assistant Summary", () => { ...@@ -103,10 +102,10 @@ new App.DomPassage("Rules Assistant Summary", () => {
return `${v}`; return `${v}`;
} }
App.UI.DOM.appendNewElement("td", row, path.join('.'), ["ra-sum", "row-title", "ra-sum-cell"]); App.UI.DOM.appendNewElement("td", row, path.join('.'), ["ra-sum", "row-title"]);
for (const cell of cells) { for (const cell of cells) {
const content = cell !== null ? ruleSetValueToString(cell) : null; const content = cell !== null ? ruleSetValueToString(cell) : null;
App.UI.DOM.appendNewElement("td", row, content, "ra-sum-cell"); App.UI.DOM.appendNewElement("td", row, content, "ra-sum");
} }
table.append(row); table.append(row);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment