Open mikael1611 opened 9 years ago
+1
You are definitely my hero for the week. I spent 3 full days looking for a solution to this problem. I was blaming my coding (as I always do), so I was miles away from the real issue.
$.Jcrop.component.DragState.prototype.touch = null;
works perfectly.... and I would NEVER have found it without you. THANKS SO, SO, SO much!!!!!!!!!
+1
+1 OMFG . I literally spent 6 hours f*cking around with this until I started to believe the lib was broke. Thanks for the workaround!
This hasn't been solved in the lib yet, has it? The check made here must be the offending section necessitating the null
reset: JcropTouch.js (lines: 27-32)
I'm just diving into using this on a project, so I'm not familiar with the code yet. Can this kind of reset be performed on $(selector).Jcrop('api').destroy()
? Given that the fix manipulates the prototype, maybe there's a better instance check for initializing touch events?
You can also try this code. It works for me.
function destroyAndRecreate() { $("#target").data('Jcrop').destroy(); $('#target').Jcrop({ setSelect: [ 175, 100, 400, 300 ] }); }
Hi, I noticed Events Touch are not initialized after we destroyed and recreated a JCrop instance. Try it yourself with your Mobile or Chrome Emulating Touch Mode
To solve it temporary, I use this command after destroy() instruction $.Jcrop.component.DragState.prototype.touch = null;
Try with Jcrop basic.html demo page and call the following instruction: