1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-01 20:32:13 +02:00

♻️ 🔨 🐛 e.g. better namespace #18

This commit is contained in:
2023-09-19 09:30:21 +02:00
parent 9c5ac96ab8
commit 1df797e316
9 changed files with 64 additions and 59 deletions

View File

@ -5,7 +5,12 @@ let namespace_curr= "html";
export function namespace(namespace){
namespace_curr= namespace==="svg" ? "http://www.w3.org/2000/svg" : namespace;
return {
append(el){ namespace_curr= "html"; return el; }
append(...el){
namespace_curr= "html";
if(el.length===1) return el[0];
const f= document.createDocumentFragment();
return f.append(...el);
}
};
}
export function createElement(tag, attributes, ...connect){