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:
@ -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){
|
||||
|
Reference in New Issue
Block a user