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

Unified Diff: sky/examples/radio.sky

Issue 692563003: Docs: Update radio.sky to use the specced API for shadow roots (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | 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 5920e50e97e3a69374c4ee8321a5fc064b0e3a3f..a253af312169832af9f176f9938ca75329c917e2 100644
--- a/sky/examples/radio.sky
+++ b/sky/examples/radio.sky
@@ -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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698