Redraw highlight divs when the viewport is resized#159
Redraw highlight divs when the viewport is resized#159jansc wants to merge 2 commits intoreadium:developfrom
Conversation
|
Hi, sorry I just got a chance to look at this now.. I would much rather like exposing this redrawHighlights as a public function in reader_view, so then who ever needs to use it, they can call it from a PAGINATION_CHANGED event callback or manually when needed. Calling it when this event triggers should cover all cases when they should be redrawn. |
|
Thanks for the feedback and sorry for the late answer. I'll update this pull request soon with redrawHighlights() as a public function in reader_view. |
|
I'm sorry it took so long to implement your suggestions, but now I've committed an update. If I got you right, the new |
When the viewport of the cloud reader is resized, the highlights show up at apparently random locations. This is because the absolutely positioned highlight-divs are not repositioned when the window is resized.
Digging into the annotation module in Readium I saw that the code for redrawing the highlight divs is available in the redraw()-method, it's just never called. This patch solves the problem in the cloud reader, but I'm not sure if calling redrawHighlights from js/views/reader_view.js:handleViewportResize() is enough.
Any help would be appreciated!
Jan