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

Unified Diff: sky/examples/color/color-wheel.sky

Issue 897683002: Extend the sky color picker example (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/examples/color/color-samples.sky ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/color/color-wheel.sky
diff --git a/sky/examples/color/color-wheel.sky b/sky/examples/color/color-wheel.sky
index be053749d20da63a7128ee1325faad94433fa021..da10a116c8b9050edefac17bdd3f02f0069a956d 100644
--- a/sky/examples/color/color-wheel.sky
+++ b/sky/examples/color/color-wheel.sky
@@ -7,8 +7,7 @@
<sky-element name="color-wheel"
attributes="color:string"
- on-pointerdown="handlePointerDown"
- on-pointermove="handlePointerMove">
+ on-pointerdown="handlePointerDown">
<template>
<style>
img {
@@ -65,6 +64,12 @@ module.exports = class extends SkyElement {
created() {
super.created();
this.color = "#xFF00FF";
+ this.colorChanged = function() {
+ this.dispatchEvent(new CustomEvent('color-change', {
+ bubbles: true,
+ detail: this.color,
+ }));
+ };
}
updateColor(event) {
var bounds = event.target.getBoundingClientRect();
@@ -78,9 +83,6 @@ module.exports = class extends SkyElement {
handlePointerDown(event) {
this.updateColor(event);
}
- handlePointerMove(event) {
- this.updateColor(event);
- }
}.register();
</script>
</sky-element>
« no previous file with comments | « sky/examples/color/color-samples.sky ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698