Index: sky/examples/file-browser.sky |
diff --git a/sky/examples/file-browser.sky b/sky/examples/file-browser.sky |
index ba456ae9e3f1d1bda820aa63d46c8b00d2dfb642..f71672c36d6b4c96c05515fe8e59f5315c023024 100644 |
--- a/sky/examples/file-browser.sky |
+++ b/sky/examples/file-browser.sky |
@@ -6,6 +6,7 @@ |
<import src="../framework/sky-element/sky-element.sky" as="SkyElement" /> |
<import src="../framework/xmlhttprequest.sky" as="XMLHttpRequest" /> |
+<sky-element name="file-browser"> |
<template> |
<style> |
heading { |
@@ -21,12 +22,13 @@ |
</template> |
</template> |
<script> |
-SkyElement({ |
- name: 'file-browser', |
- url: '', |
- files: [], |
- directories: [], |
- attached: function() { |
+module.exports = class extends SkyElement { |
+ created() { |
+ this.url = ''; |
+ this.files = []; |
+ this.directories = []; |
+ } |
+ attached() { |
this.url = this.ownerDocument.URL; |
var xhr = new XMLHttpRequest(); |
xhr.open('GET', this.url + '?format=json'); |
@@ -37,5 +39,6 @@ SkyElement({ |
}).bind(this); |
xhr.send(); |
} |
-}); |
+}.register(); |
</script> |
+</sky-element> |