Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: tests/io-element.js

Issue 29730644: Issue 6514 - IOToggle Custom Element (Closed)
Left Patch Set: Created March 23, 2018, 10:25 a.m.
Right Patch Set: applied latest required changes Created May 2, 2018, 12:13 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « package.json ('k') | tests/io-toggle.html » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 /* globals module, require */
2
3 "use strict"; 1 "use strict";
4 2
5 const IOElement = require("../js/io-element"); 3 const IOElement = require("../js/io-element");
6 4
7 class IOClock extends IOElement 5 class IOClock extends IOElement
8 { 6 {
9 connectedCallback() 7 connectedCallback()
10 { 8 {
11 this._timer = setInterval(() => this.render(), 1000); 9 this._timer = setInterval(() => this.render(), 1000);
12 } 10 }
13 11
14 disconnectedCallback() 12 disconnectedCallback()
15 { 13 {
16 clearInterval(this._timer); 14 clearInterval(this._timer);
17 } 15 }
18 16
19 render() 17 render()
20 { 18 {
21 this.html` 19 this.html`
22 ${{i18n: "io_clock"}} 20 ${{i18n: "io_clock"}}
23 @${(new Date()).toLocaleTimeString()} 21 @${(new Date()).toLocaleTimeString()}
24 `; 22 `;
25 } 23 }
26 } 24 }
27 25
28 IOClock.define("io-clock"); 26 IOClock.define("io-clock");
LEFTRIGHT

Powered by Google App Engine
This is Rietveld