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

Side by Side Diff: sky/tests/resources/test-element.sky

Issue 1177843010: Delete sky-element framework (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/framework/elements/sky-toolbar.sky ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!--
2 // Copyright 2014 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 -->
6 <import src="/sky/framework/elements/sky-checkbox.sky" />
7 <import src="/sky/framework/elements/sky-element/sky-element.sky" as="SkyElement " />
8
9 <sky-element
10 name="test-element"
11 attributes="size:number, checked:boolean,name:string"
12 on-host-event="handleEvent">
13 <template>
14 <div id="inside" on-test-event="handleEvent" lang="{{ value }}">{{ value }}</d iv>
15 <sky-checkbox id="checkbox" checked="{{ checked }}" />
16 </template>
17 <script>
18 module.exports = class extends SkyElement {
19 created() {
20 this.lastEvent = null;
21 this.value = 10;
22 this.shadowRootReadyCount = 0;
23 this.changes = [];
24 }
25 handleEvent(event) {
26 this.lastEvent = event;
27 }
28 shadowRootReady() {
29 this.shadowRootReadyCount++;
30 }
31 sizeChanged(oldValue, newValue) {
32 this.recordAttributeChange('size', oldValue, newValue);
33 }
34 checkedChanged(oldValue, newValue) {
35 this.recordAttributeChange('checked', oldValue, newValue);
36 }
37 nameChanged(oldValue, newValue) {
38 this.recordAttributeChange('name', oldValue, newValue);
39 }
40 recordAttributeChange(name, oldValue, newValue) {
41 this.changes.push({
42 name: name,
43 newValue: newValue,
44 oldValue: oldValue,
45 });
46 }
47 }.register();
48 </script>
49 </sky-element>
OLDNEW
« no previous file with comments | « sky/sdk/lib/framework/elements/sky-toolbar.sky ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698