diff --git a/app/static/app.js b/app/static/app.js index a1d5aa8..64c4bcd 100644 --- a/app/static/app.js +++ b/app/static/app.js @@ -59,6 +59,12 @@ function badge(state) { function el(tag, attrs = {}, ...children) { const node = document.createElement(tag); + // Allow el("tr", child1, child2, ...): if the 2nd argument is a node or an + // array, treat it as the first child instead of an attributes object. + if (attrs && (attrs.nodeType === 1 || Array.isArray(attrs))) { + children.unshift(attrs); + attrs = {}; + } for (const [k, v] of Object.entries(attrs || {})) { if (k === "class") node.className = v; else if (k === "text") node.textContent = v;