Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions js/views/annotations_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ ReadiumSDK.Views.AnnotationsManager = function (proxyObj, options) {
return result;
};

this.redrawHighlights = function() {
for(var spine in liveAnnotations) {
var annotationsForView = liveAnnotations[spine];
annotationsForView.redraw();
}
};


function getPartialCfi(CFI) {
Expand Down
11 changes: 11 additions & 0 deletions js/views/reader_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,17 @@ ReadiumSDK.Views.ReaderView = function(options) {
return _annotationsManager.removeHighlight(id);
};

/**
* Redraws all highlights. Calling this function from a
* PAGINATION_CHANGED event callback should cover all cases
* when annotations should be redrawn.
*
* @returns {undefined}
*/
this.redrawHighlights = function () {
_annotationsManager.redrawHighlights();
};

/**
*
* @param {string} eventName Event name.
Expand Down