From 4e67cba014fb7e284ed4994d7b374198eb475457 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Mon, 13 Sep 2021 14:14:42 +0200 Subject: [PATCH] Add special case for dataset to skooma templating --- skooma.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/skooma.js b/skooma.js index 20bc659..f481b13 100644 --- a/skooma.js +++ b/skooma.js @@ -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")