Add special case for dataset to skooma templating

This commit is contained in:
Talia 2021-09-13 14:14:42 +02:00
parent 742eb36035
commit 4e67cba014
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E

View file

@ -50,6 +50,9 @@ const parseArgs = (element, before, ...args) => {
for (let key in arg)
if (key == "style" && typeof(arg[key])=="object")
insertStyles(element.style, arg[key])
else if (key == "dataset" && typeof(arg[key])=="object")
for (let [key2, value] of Object.entries(arg[key]))
element.dataset[key2] = parseAttribute(value)
else if (key == "shadowRoot")
parseArgs((element.shadowRoot || element.attachShadow({mode: "open"})), null, arg[key])
else if (typeof arg[key] === "function")