[annotator-dev] Loading Annotations Asynchronously

Randall Leeds tilgovi at hypothes.is
Sun Jan 26 02:06:39 UTC 2014


On Jan 25, 2014 4:04 PM, "Jamie M Folsom" <jfolsom at mit.edu> wrote:
>
> Hey Randall,
>
> Sure. I set up the annotator, then get a reference to it with:
>
> var subscriber = $('#textcontent').annotator().data('annotator');
>
> Then I define an on click function for a filter control, which sets up a
loadOptions object, and calls:
>
> subscriber.plugins.Store.loadAnnotationsFromSearch(loadOptions);
>
> That works, in that the data are correctly loaded from the API. What’s
not happening, is that the annotator doesn’t reload the new annotations in
the DOM, and/or the highlights are not shown in the text.

Have you at this point changed the content in the DOM?

My thinking is that maybe it's loading from an empty search first, then
maybe if you later swap out DOM content but don't clear the store cache the
subsequent load is a noop.

Do you see an earlier search request in the network log?

> Is there another step the annotator takes after loading or loading from
search, to display or update display of highlights?

It calls `annotator.loadAnnotations` or, if that ID was loaded earlier I
think it calls `updateAnnotation` but that will not re-anchor the
annotation in the DOM.

If you're sure this worked in an earlier version and you're comfortable
building Annotator you could git bisect your way to the commit that broke
this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140125/7fba23a3/attachment-0004.html>


More information about the annotator-dev mailing list