Commit 1ff68e88 authored by Randall Leeds's avatar Randall Leeds

Anchor attempts happen in an animation frame

parent c42ee255
...@@ -151,6 +151,7 @@ module.exports = class Guest extends Annotator ...@@ -151,6 +151,7 @@ module.exports = class Guest extends Annotator
{anchored, unanchored, element, plugins} = this {anchored, unanchored, element, plugins} = this
maybeAnchor = (target) -> maybeAnchor = (target) ->
return new Promise(raf).then ->
anchoring.anchor(target.selector) anchoring.anchor(target.selector)
.then(highlightRange) .then(highlightRange)
.then((highlights) -> {annotation, target, highlights}) .then((highlights) -> {annotation, target, highlights})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment