Closed placenamehere closed 11 years ago
Not only that, cancelSelection did not reset the selection correctly.
The issue with cancelSelection is fixed in jquery.imgareaselect.dev.js. The onSelectEnd is fired when clicked outside of the selection. In this function you can check if selection.height and selection.width are 0
currently, when cancelSelection() is triggered (such as when the area outside the region is clicked) there isn't a callback that you could use to trigger other cleanup events.
An example where this would be useful is if you want to show some additional UI only when there is an active region. There are existing callback for Start/End so you could use one of those to display the additional UI, but there isn't an appropriate hook to use to then hide it.
Probably as easy as adding an options.onSelectCancel() call in function cancelSelection(), but I haven't tested that solution. If I have time, and wind up that I do need it for this project I'm on, I may for and do just that.