Refactor scripts into ES6 modules
This commit is contained in:
parent
bbbb23427a
commit
c8fd5b1c40
2 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
class BetterHTMLElement extends HTMLElement {
|
||||
export class BetterHTMLElement extends HTMLElement {
|
||||
attributeChangedCallback(name, old, value) { this[name+"Changed"](value, old) }
|
||||
|
||||
// Array of connected callbacks
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function setup(root) {
|
||||
const setup = (root) => {
|
||||
root.parts = {}
|
||||
root.querySelectorAll("[part-id]").forEach( element => {
|
||||
root.parts[element.getAttribute("part-id")] = element
|
||||
|
@ -7,7 +7,7 @@ function setup(root) {
|
|||
return root
|
||||
}
|
||||
|
||||
function template(strings, ...args) {
|
||||
export const template = (strings, ...args) => {
|
||||
let buf = []
|
||||
for (i=0;i<strings.length;i++) {
|
||||
buf.push(strings[i], args[i])
|
||||
|
|
Loading…
Reference in a new issue