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

Anchor attempts happen in an animation frame

parent c42ee255
......@@ -151,10 +151,11 @@ module.exports = class Guest extends Annotator
{anchored, unanchored, element, plugins} = this
maybeAnchor = (target) ->
anchoring.anchor(target.selector)
.then(highlightRange)
.then((highlights) -> {annotation, target, highlights})
.catch((reason) -> {annotation, target, reason})
return new Promise(raf).then ->
anchoring.anchor(target.selector)
.then(highlightRange)
.then((highlights) -> {annotation, target, highlights})
.catch((reason) -> {annotation, target, reason})
highlightRange = (range) ->
return new Promise(raf).then ->
......
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