Commit 41607799 authored by Randall Leeds's avatar Randall Leeds

Draw highlights in an animation frame

parent 9fbde23b
raf = require('raf')
Promise = global.Promise or require('es6-promise').Promise Promise = global.Promise or require('es6-promise').Promise
Annotator = require('annotator') Annotator = require('annotator')
$ = Annotator.$ $ = Annotator.$
...@@ -149,8 +150,9 @@ module.exports = class Guest extends Annotator ...@@ -149,8 +150,9 @@ module.exports = class Guest extends Annotator
.catch((reason) -> {annotation, target, reason}) .catch((reason) -> {annotation, target, reason})
highlightRange = (range) -> highlightRange = (range) ->
normedRange = Annotator.Range.sniff(range).normalize(root) return new Promise(raf).then ->
return highlighter.highlightRange(normedRange) normedRange = Annotator.Range.sniff(range).normalize(root)
return highlighter.highlightRange(normedRange)
storeAndSync = (results) -> storeAndSync = (results) ->
highlighted = false highlighted = false
......
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