Docs: Update radio.sky to use the specced API for shadow roots
Review URL: https://codereview.chromium.org/692563003
This commit is contained in:
parent
f1aae9495a
commit
3c9e2c9dd2
@ -14,7 +14,7 @@ SKY MODULE - radio button and radio button group
|
|||||||
module.exports.RadioElement = sky.registerElement('radio', class extends Element {
|
module.exports.RadioElement = sky.registerElement('radio', class extends Element {
|
||||||
constructor () {
|
constructor () {
|
||||||
this.addEventListener('click', (event) => this.checked = true);
|
this.addEventListener('click', (event) => this.checked = true);
|
||||||
this.createShadowTree().appendChild(module.document.findId('radio-shadow').content.cloneNode(true));
|
this.addShadowRoot(new sky.ShadowRoot(module.document.findId('radio-shadow').content.cloneNode(true)));
|
||||||
}
|
}
|
||||||
get checked () {
|
get checked () {
|
||||||
return this.hasAttribute('checked');
|
return this.hasAttribute('checked');
|
||||||
@ -48,7 +48,7 @@ SKY MODULE - radio button and radio button group
|
|||||||
<script>
|
<script>
|
||||||
module.exports.RadioGroupElement = sky.registerElement('radiogroup', class extends Element {
|
module.exports.RadioGroupElement = sky.registerElement('radiogroup', class extends Element {
|
||||||
constructor () {
|
constructor () {
|
||||||
this.createShadowTree().appendChild(module.document.findId('radiogroup-shadow').cloneNode(true));
|
this.addShadowRoot(new sky.ShadowRoot(module.document.findId('radiogroup-shadow').content.cloneNode(true)));
|
||||||
}
|
}
|
||||||
get value () {
|
get value () {
|
||||||
let children = this.getChildNodes();
|
let children = this.getChildNodes();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user