Commit bc6342e1 authored by csillag's avatar csillag

Postpone the scanning

... to the point when the panel is already ready.

Hopefully, this makes the sidebar connect and appear sooner.

We can't delay in any further, because setting the
visible highlights (which happens in the next line)
will trigger a bucket bar (a.k.a. heatmap) refresh,
and the heatmap uses information produced by the scanning.
parent 59b9508b
......@@ -40,6 +40,7 @@ class Annotator.Host extends Annotator.Guest
# Host frame dictates the toolbar options.
this.on 'panelReady', =>
this.setTool('comment')
this._scan() # Scan the document
this.setVisibleHighlights(!!options.showHighlights)
if @plugins.BucketBar?
......@@ -48,9 +49,6 @@ class Annotator.Host extends Annotator.Guest
if @frame.hasClass 'annotator-collapsed'
this.showFrame()
# Scan the document
this._scan()
actuallyShowFrame: (options={transition: true}) ->
unless @drag.enabled
@frame.css 'margin-left': "#{-1 * @frame.width()}px"
......
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