Docs: Update radio.sky to use the specced API for shadow roots

Review URL: https://codereview.chromium.org/692563003
This commit is contained in:
Hixie 2014-10-29 13:10:33 -07:00
parent 3f008050a2
commit 5482eece0f

View file

@ -14,7 +14,7 @@ SKY MODULE - radio button and radio button group
module.exports.RadioElement = sky.registerElement('radio', class extends Element {
constructor () {
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 () {
return this.hasAttribute('checked');
@ -48,7 +48,7 @@ SKY MODULE - radio button and radio button group
<script>
module.exports.RadioGroupElement = sky.registerElement('radiogroup', class extends Element {
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 () {
let children = this.getChildNodes();