Anyone Figure Out "onEndCrop" Happening With Every Click?

18 views
Skip to first unread message

Jimmy

unread,
Feb 18, 2009, 9:37:11 AM2/18/09
to javascript-image-cropper-ui
Hey there

I'm trying to figure out a way to mark that my cropper has changed
since the initial load. It would be great to attach this to the
onEndCrop method (ie: the crop has ended, so the cropper has changed
dimensions), but it fires on every click on the webpage.

Has anyone figured out a way to stop onEndCrop firing with every
single click on the web page? I recall someone noting that its
necessary, but....

Dave Spurr

unread,
Feb 18, 2009, 10:57:13 AM2/18/09
to javascript-im...@googlegroups.com
Yeah I think it was me who mentioned that it is a little more to rework
than the original poster of this issue thought. What it really needs to
do is (and go ahead and do this if you and submit a patch):

1) Only add the onclick handlers for starting, moving resizing etc. when
the mouse is over the image crop area
2) Remove the onclick handlers if the user has finished a crop (unless
they're still over the image crop area)
3) Remove the onclick handlers if the user's mouse goes off the image
area (unless they're in the middle of a crop/move/resize action)

As if you just changed the handlers as is to work when the users mouse
is over the image you'd get that annoying gap around the edge of the
crop area if you dragged it to one edge of the image too quickly (well
you don't even have to be that quick).

I really do apologise but I have been super super busy these past few
months and haven't had chance to look at the code base lately.

-D
Reply all
Reply to author
Forward
0 new messages