From 2c8c1eb7678e8877b02c6afbb1b451a6db0faf7b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 29 Apr 2020 19:12:48 +0200 Subject: [PATCH] move el with the publics --- src/ui/web/general/TemplateView.js | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) 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) {