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

Unified Diff: sky/examples/appish/example-scaffold.sky

Issue 942413002: Port sky-drawer to Dart (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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/appish.sky ('k') | sky/examples/appish/index.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/appish/example-scaffold.sky
diff --git a/sky/examples/example-scaffold.sky b/sky/examples/appish/example-scaffold.sky
similarity index 72%
rename from sky/examples/example-scaffold.sky
rename to sky/examples/appish/example-scaffold.sky
index 553d1c7e01ce3c4f1c1c405e2314ad0c7b1c4c62..0d810ccbe266b6055c3d3e73ac5a9a525e368d4a 100644
--- a/sky/examples/example-scaffold.sky
+++ b/sky/examples/appish/example-scaffold.sky
@@ -4,10 +4,10 @@
// found in the LICENSE file.
-->
<import src="/sky/framework/sky-drawer.sky" />
-<import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" />
+<import src="/sky/framework/sky-element.sky" />
<import src="/sky/framework/sky-scrollable.sky" />
-<sky-element name="example-scaffold">
+<sky-element>
<template>
<style>
:host {
@@ -54,7 +54,7 @@
<content select=".menu"/>
</sky-drawer>
<sky-toolbar>
- <div id="menu" on-click="handleMenuClick"/>
+ <div id="menu" />
<content id="title" select=".title"/>
</sky-toolbar>
<sky-scrollable>
@@ -62,18 +62,23 @@
</sky-scrollable>
</template>
<script>
-module.exports = class extends SkyElement {
- created() {
- this.toolbar_ = null;
- }
+import "dart:sky";
+
+@Tagname('example-scaffold')
+class ExampleScaffold extends SkyElement {
+ Element _drawer;
- shadowRootReady() {
- this.toolbar_ = this.shadowRoot.getElementById('drawer');
+ void shadowRootReady() {
+ _drawer = shadowRoot.getElementById('drawer');
+ Element menu = shadowRoot.getElementById('menu');
+ menu.addEventListener('click', _handleMenuClick);
}
- handleMenuClick() {
- this.toolbar_.toggle();
+ void _handleMenuClick(_) {
+ _drawer.toggle();
}
-}.register();
+}
+
+_init(script) => register(script, ExampleScaffold);
</script>
</sky-element>
« no previous file with comments | « sky/examples/appish.sky ('k') | sky/examples/appish/index.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698