diff options
Diffstat (limited to 'src/z/z.js')
| -rw-r--r-- | src/z/z.js | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -47,7 +47,7 @@ class Zenv { populate_attributes(obj, attrs) { for (const attr in attrs) { if (typeof(obj[attr]) == 'object' && typeof(attrs[attr]) == 'object') { - populate_attributes(obj[attr], attrs[attr]); + this.populate_attributes(obj[attr], attrs[attr]); } else { obj[attr] = attrs[attr]; } @@ -56,7 +56,7 @@ class Zenv { native(name, options) { const element = document.createElement(name); - Zenv.populate_attributes(element, options); + this.populate_attributes(element, options); return element; } @@ -71,6 +71,10 @@ class Zenv { by_selector_all(query) { return this.document.shadowRoot.querySelectorAll(query); } + + get body() { + return this.document.shadowRoot; + } } Z = new Zenv(document.body); |