-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in positioning of annotations #243
Comments
It's not as simple as In many uses of Annotator, both of these are true. When the body, or some other parent of the wrapper div, is not at (0, 0), the current version breaks. The old version worked. This is a proper regression. However, in hypothesis/h, we don't use the wrapper div because I find it to be nasty and unnecessary to manipulate the DOM that way. That was what motivated the change. Here's a plunk which demonstrates: http://plnkr.co/edit/FVmBmchrO3zmcYTTDtTJ The proper solution is to check the offset parent. If the offset parent of the target is the wrapper, then the .offset() of that should be taken. Otherwise, the .offset() of the offset parent of the wrapper should be taken as the origin point. |
There's an additional issue you can see in the plunk, which I have not finished finding a solution for, which is when the target is itself the wrapper. You can see it in the plunk by clicking somewhere around the edges of the list such that the entire wrapper is highlighted in red as the target. |
Plunk updated to reflect possible solution. Pull request forthcoming. |
Project: mediawiki/extensions/Annotator cbc0ac1f406b276690a28c64c4752e2098b8b6b6 Added the destroy class The id parameter is being passed and annotations are deleted and return a 204 http status code. The annotator-full.js has been rebuilt from upstream after the bug openannotation/annotator#243 is fixed and now there is no positioning error. Change-Id: I13af0a1522e253d5e8e5f99d58aeaea74b2bc7e3
The annotations are not placed over the quotes hovered, rather they are being placed at some posiiton below the actual text. This may be caused due to the change d45a366 . I think offset() is relative to the document and position() is relative to offset. So using position() seems wrong here.
http://api.jquery.com/offset/
http://api.jquery.com/position/
The text was updated successfully, but these errors were encountered: