diff --git a/src/ui/web/general/TemplateView.js b/src/ui/web/general/TemplateView.js index ae7766dc..22bb7e43 100644 --- a/src/ui/web/general/TemplateView.js +++ b/src/ui/web/general/TemplateView.js @@ -181,24 +181,6 @@ class TemplateBuilder { return node; } - el(name, attributes, children) { - if (attributes && isChildren(attributes)) { - children = attributes; - attributes = null; - } - - const node = document.createElement(name); - - if (attributes) { - this._setNodeAttributes(node, attributes); - } - if (children) { - this._setNodeChildren(node, children); - } - - return node; - } - _setNodeAttributes(node, attributes) { for(let [key, value] of Object.entries(attributes)) { const isFn = typeof value === "function"; @@ -255,6 +237,24 @@ class TemplateBuilder { return node; } + el(name, attributes, children) { + if (attributes && isChildren(attributes)) { + children = attributes; + attributes = null; + } + + const node = document.createElement(name); + + if (attributes) { + this._setNodeAttributes(node, attributes); + } + if (children) { + this._setNodeChildren(node, children); + } + + return node; + } + // this insert a view, and is not a view factory for `if`, so returns the root element to insert in the template // you should not call t.view() and not use the result (e.g. attach the result to the template DOM tree). view(view) {