annotorious / annotorious-v1

Project has moved to http://github.com/annotorious/annotorious
https://annotorious.com
MIT License
593 stars 142 forks source link

How to override editAnnotation from from image.annotator inside plugin #197

Open headkit opened 6 years ago

headkit commented 6 years ago

hi! I am new to this framework. I like it a lot - thanx for sharing it!

I want to make annotation rectangles clickable. I first tried to add a mouseup event to the canvas and if the popup is visible then trigger the click event from the edit button. unfortunately this is not working because the rectangle is removed due to the

this._viewer.removeAnnotation(annotation);

in editAnnotation() from image.annotator

I then thought about overriding editAnnotation, adding a sceond parameter 'shouldRemoveRect' or something, but I don't know how to reach _viewver since it is private.

it may be that I did not understand the construction of the framework correctly. Could you please give me a hint how to solve this? thnx!