Commit 01c0ea37 authored by Aron Carroll's avatar Aron Carroll

WIP Show the sidebar on load

If the firstRun option is provided to the hypothesisConfig.
parent d691908a
......@@ -58,6 +58,7 @@ class Annotator.Guest extends Annotator
origin: origin
scope: "#{scope}:provider"
onReady: =>
@trigger('panelReady')
setTimeout =>
event = document.createEvent "UIEvents"
event.initUIEvent "annotatorReady", false, false, window, 0
......@@ -66,7 +67,7 @@ class Annotator.Guest extends Annotator
# Load plugins
for own name, opts of @options
if not @plugins[name]
if not @plugins[name] and Annotator.Plugin[name]
this.addPlugin(name, opts)
unless config.dontScan
......
......@@ -29,6 +29,9 @@ class Annotator.Host extends Annotator.Guest
app.appendTo(@frame)
if options.firstRun
this.on 'panelReady', this.actuallyShowFrame(transition: false)
if @plugins.Heatmap?
this._setupDragEvents()
@plugins.Heatmap.element.on 'click', (event) =>
......@@ -38,17 +41,21 @@ class Annotator.Host extends Annotator.Guest
# Scan the document
this._scan()
actuallyShowFrame: (options={transition: true}) ->
unless @drag.enabled
@frame.css 'margin-left': "#{-1 * @frame.width()}px"
if options.transition
@frame.removeClass 'annotator-no-transition'
else
@frame.addClass 'annotator-no-transition'
@frame.removeClass 'annotator-collapsed'
_setupXDM: (options) ->
channel = super
channel
.bind('showFrame', (ctx) =>
unless @drag.enabled
@frame.css 'margin-left': "#{-1 * @frame.width()}px"
@frame.removeClass 'annotator-no-transition'
@frame.removeClass 'annotator-collapsed'
)
.bind 'showFrame', (ctx) => this.actuallyShowFrame()
.bind('hideFrame', (ctx) =>
@frame.css 'margin-left': ''
......
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