Permalink
Browse files

Fixes Chrome problem and deals with pull #66 and issue #35.

  • Loading branch information...
1 parent f927734 commit 1b253ea4e71ac1e12377b087aeadcce38ded7db6 @sadfuzzy sadfuzzy committed with Dec 28, 2012
Showing with 11 additions and 9 deletions.
  1. +7 −5 js/jquery.Jcrop.js
  2. +4 −4 js/jquery.Jcrop.min.js
View
@@ -1158,11 +1158,13 @@
function trackMove(e) //{{{
{
//init 4 ios...
- var i;
- i = e.originalEvent.changedTouches[0].clientX;
- i = e.originalEvent.changedTouches[0].clientY;
- i = e.originalEvent.changedTouches[0].pageX;
- i = e.originalEvent.changedTouches[0].pageY;
+ if (e.originalEvent && e.originalEvent.changedTouches) {
+ var i;
+ i = e.originalEvent.changedTouches[0].clientX;
+ i = e.originalEvent.changedTouches[0].clientY;
+ i = e.originalEvent.changedTouches[0].pageX;
+ i = e.originalEvent.changedTouches[0].pageY;
+ }
onMove(mouseAbs(e));
return false;
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

2 comments on commit 1b253ea

Contributor

Gladhon replied Jan 7, 2013

Unfortunetly bug #35 come's back with your if-declaration, I changed it to a more specific one, can you test it ?

if (Touch.support){
Owner

tapmodo replied Jan 7, 2013

I did some more debugging on this problem and came up with, I think, a comprehensive fix. The problem with the jumping on iOS turned out to be that both "touchmove" and "mousemove" were being called as the touch drag event was happening. Anyway, I sorted it out and pushed the commits just now.

Also, may benefit performance since half the events are happening?

Please test!

Please sign in to comment.