Specs: make element registrations be per-module, define how they are
exported and reexported, rename 'interface' to 'class' in the IDL, add constructors to all registered elements R=esprehn@chromium.org Review URL: https://codereview.chromium.org/695043002
This commit is contained in:
@@ -72,10 +72,10 @@ SKY MODULE
|
||||
class extends SkyElement {
|
||||
constructor () {
|
||||
this.addEventListener('click', (event) => this.updateTime());
|
||||
this.createShadowTree().appendChild('Click to show the time');
|
||||
this.shadowRoot.appendChild('Click to show the time');
|
||||
}
|
||||
updateTime() {
|
||||
this.shadowTree.firstChild.replaceWith(new Date());
|
||||
this.shadowRoot.firstChild.replaceWith(new Date());
|
||||
}
|
||||
}
|
||||
</sky-element>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
SKY MODULE - radio button and radio button group
|
||||
<!-- accessibility handling not implemented yet, pending mojo service -->
|
||||
<import src="sky:core" as="sky"/>
|
||||
|
||||
<script>
|
||||
module.exports = {};
|
||||
</script>
|
||||
|
||||
<!-- <radio> -->
|
||||
<template id="radio-shadow">
|
||||
@@ -10,8 +13,7 @@ SKY MODULE - radio button and radio button group
|
||||
</style>
|
||||
</template>
|
||||
<script>
|
||||
module.exports = {};
|
||||
module.exports.RadioElement = sky.registerElement({
|
||||
module.exports.RadioElement = module.registerElement({
|
||||
tagName: 'radio',
|
||||
shadow: true,
|
||||
prototype: class extends Element {
|
||||
@@ -51,7 +53,7 @@ SKY MODULE - radio button and radio button group
|
||||
</style>
|
||||
</template>
|
||||
<script>
|
||||
module.exports.RadioGroupElement = sky.registerElement({
|
||||
module.exports.RadioGroupElement = module.registerElement({
|
||||
tagName: 'radiogroup',
|
||||
shadow: true,
|
||||
prototype: class extends Element {
|
||||
|
||||
Reference in New Issue
Block a user