Some fixes

This commit is contained in:
naielv
2025-08-04 20:31:00 +02:00
parent 0ea230e99b
commit f2588fc50f
3 changed files with 41 additions and 87 deletions

View File

@@ -749,8 +749,9 @@ function TS_IndexElement(
config.forEach((key) => {
switch (key.type) {
case "raw":
case "text":
const tdRaw = document.createElement("td");
const rawContent = (data[key.key] || key.default || "").replace(
const rawContent = (String(data[key.key]) || key.default || "").replace(
/\n/g,
"<br>"
);
@@ -759,9 +760,8 @@ function TS_IndexElement(
break;
case "template":
const tdCustomTemplate = document.createElement("td");
tdCustomTemplate.style.verticalAlign = "top";
tdCustomTemplate.innerHTML = key.format(data);
new_tr.appendChild(tdCustomTemplate);
key.template(data, tdCustomTemplate);
break;
case "comanda":
const tdComanda = document.createElement("td");