Permalink
Browse files

Make change trigger on initial tap

  • Loading branch information...
1 parent 287b439 commit 9e18be356e015cc61e456bc0f5fb568ae91e022f @bebraw committed Jul 4, 2012
Showing with 17 additions and 11 deletions.
  1. +17 −11 src/colorjoe.js
View
@@ -28,24 +28,30 @@ var ret = function(element, initialColor) {
div('bg', oned);
drag(oned, {
- change: function(p) {
- hsv.h(p.y);
- H(p.y);
- changed(hsv);
- },
+ begin: changeHS,
+ change: changeHS,
end: done
});
+ function changeHS(p) {
+ hsv.h(p.y);
+ H(p.y);
+ changed(hsv);
+ }
+
drag(twod, {
- change: function(p) {
- hsv.s(p.x);
- hsv.v(1 - p.y);
- SV(p.x, p.y);
- changed(hsv);
- },
+ begin: changeS,
+ change: changeS,
end: done
});
+ function changeS(p) {
+ hsv.s(p.x);
+ hsv.v(1 - p.y);
+ SV(p.x, p.y);
+ changed(hsv);
+ }
+
H(hsv.h());
SV(hsv.s(), hsv.v());

0 comments on commit 9e18be3

Please sign in to comment.