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

Unified Diff: sky/examples/radio.sky

Issue 701873004: Specs: define registerElement() more carefully; add an 'end tag (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/README.md ('k') | sky/specs/apis.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/radio.sky
diff --git a/sky/examples/radio.sky b/sky/examples/radio.sky
index 36daa1c349286f264e10dbc136d24f3ee6e8b0bc..6cafa7199c0a70a02ac8c81d71fe7fc5a7045056 100644
--- a/sky/examples/radio.sky
+++ b/sky/examples/radio.sky
@@ -16,9 +16,9 @@ SKY MODULE - radio button and radio button group
module.exports.RadioElement = module.registerElement({
tagName: 'radio',
shadow: true,
- prototype: class extends Element {
- constructor () {
- super();
+ prototype: (class extends Element {
+ constructor (module) {
+ super(module);
this.addEventListener('click', (event) => this.checked = true);
this.shadowRoot.appendChild(module.document.findId('radio-shadow').content.cloneNode(true));
}
@@ -42,7 +42,7 @@ SKY MODULE - radio button and radio button group
if (this.parentNode instanceof module.exports.RadioGroupElement)
this.parentNode.setChecked(this);
}
- },
+ }).prototype,
});
</script>
@@ -56,9 +56,9 @@ SKY MODULE - radio button and radio button group
module.exports.RadioGroupElement = module.registerElement({
tagName: 'radiogroup',
shadow: true,
- prototype: class extends Element {
- constructor () {
- super();
+ prototype: (class extends Element {
+ constructor (module) {
+ super(module);
this.shadowRoot.appendChild(module.document.findId('radiogroup-shadow').content.cloneNode(true));
}
get value () {
@@ -85,6 +85,6 @@ SKY MODULE - radio button and radio button group
if (child != radio)
child.checked = false;
}
- },
+ }).prototype,
});
</script>
« no previous file with comments | « sky/README.md ('k') | sky/specs/apis.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698