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

Unified Diff: sky/examples/radio.sky

Issue 836153005: Specs: registerElement(registerElement(...)) failed to work as expected (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/htmlish/framework/element.sky ('k') | sky/specs/dom.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 6c6d29f777856b8b73b42ce86906b9a1473b6b57..02c1f6a28e108a8d3b23b37f911560941f9abc84 100644
--- a/sky/examples/radio.sky
+++ b/sky/examples/radio.sky
@@ -9,10 +9,10 @@ SKY MODULE - radio button and radio button group
</style>
</template>
<script>
- module.exports.RadioElement = module.registerElement({
- tagName: 'radio',
- shadow: true,
- constructor: class extends Element {
+ module.exports.RadioElement = module.registerElement(
+ class extends Element {
+ static get tagName() { return 'radio'; }
+ static get shadow() { return true; }
constructor (module) {
super(module);
this.addEventListener('click', (event) => this.checked = true);
@@ -38,8 +38,8 @@ SKY MODULE - radio button and radio button group
if (this.parentNode instanceof module.exports.RadioGroupElement)
this.parentNode.setChecked(this);
}
- },
- });
+ }
+ );
</script>
<!-- <radiogroup> -->
@@ -49,10 +49,10 @@ SKY MODULE - radio button and radio button group
</style>
</template>
<script>
- module.exports.RadioGroupElement = module.registerElement{
- tagName: 'radiogroup',
- shadow: true,
- constructor: (class extends Element {
+ module.exports.RadioGroupElement = module.registerElement(
+ class extends Element {
+ static get tagName() { return 'radiogroup'; }
+ static get shadow() { return true; }
constructor (module) {
super(module);
this.shadowRoot.append(module.document.findId('radiogroup-shadow').content.cloneNode(true));
@@ -81,6 +81,6 @@ SKY MODULE - radio button and radio button group
if (child != radio)
child.checked = false;
}
- },
- });
+ }
+ );
</script>
« no previous file with comments | « sky/examples/htmlish/framework/element.sky ('k') | sky/specs/dom.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698