Commit 8ac50c62 authored by Adam Barth's avatar Adam Barth

Implement <sky-input>

This CL contains a basic input element.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/831353003
parent ed3cbb54
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
// found in the LICENSE file. // found in the LICENSE file.
--> -->
<sky> <sky>
<import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement"/>
<import src="/sky/framework/sky-button/sky-button.sky"/>
<import src="/sky/framework/sky-box/sky-box.sky"/> <import src="/sky/framework/sky-box/sky-box.sky"/>
<import src="/sky/framework/sky-button/sky-button.sky"/>
<import src="/sky/framework/sky-checkbox/sky-checkbox.sky"/> <import src="/sky/framework/sky-checkbox/sky-checkbox.sky"/>
<import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement"/>
<import src="/sky/framework/sky-input.sky"/>
<import src="/sky/framework/sky-radio/sky-radio.sky"/> <import src="/sky/framework/sky-radio/sky-radio.sky"/>
<sky-element name="widget-root"> <sky-element name="widget-root">
<template> <template>
...@@ -24,6 +25,8 @@ ...@@ -24,6 +25,8 @@
} }
</style> </style>
<sky-input id="text" value="Ready" />
<sky-box title='Buttons'> <sky-box title='Buttons'>
<sky-button id='button' on-click='handleClick'>Button</sky-button> <sky-button id='button' on-click='handleClick'>Button</sky-button>
<div>highlight: {{ myButton.highlight }}</div> <div>highlight: {{ myButton.highlight }}</div>
...@@ -56,10 +59,12 @@ module.exports = class extends SkyElement { ...@@ -56,10 +59,12 @@ module.exports = class extends SkyElement {
attached() { attached() {
this.myButton = this.shadowRoot.getElementById('button'); this.myButton = this.shadowRoot.getElementById('button');
this.myCheckbox = this.shadowRoot.getElementById('checkbox'); this.myCheckbox = this.shadowRoot.getElementById('checkbox');
this.myText = this.shadowRoot.getElementById('text');
this.clickCount = 0; this.clickCount = 0;
} }
handleClick(event) { handleClick(event) {
this.clickCount++; this.clickCount++;
this.myText.value = "Moar clicking " + this.clickCount;
} }
}.register(); }.register();
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment