Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: sky/examples/file-browser.sky

Issue 788943003: Make SkyElement more classy. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Don't change indent. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/examples/city-list/city-list.sky ('k') | sky/examples/flights-app/app-header.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « sky/examples/city-list/city-list.sky ('k') | sky/examples/flights-app/app-header.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698