Add event listeners to skooma.js
This commit is contained in:
parent
62f974b878
commit
124857f7f8
1 changed files with 4 additions and 1 deletions
|
@ -18,7 +18,10 @@ const parseArgs = (element, args) => {
|
|||
parseArgs(element, arg)
|
||||
else
|
||||
for (let key in arg)
|
||||
element.setAttribute(key, parseAttribute(arg[key]))
|
||||
if (typeof arg[key] == "function")
|
||||
element.addEventListener(key.replace(/^on[A-Z]/, x => x.charAt(x.length-1).toLowerCase()), arg[key])
|
||||
else
|
||||
element.setAttribute(key, parseAttribute(arg[key]))
|
||||
}
|
||||
|
||||
const node = (name, args, xmlns) => {
|
||||
|
|
Loading…
Reference in a new issue