Commit 7eb5f40f authored by Randall Leeds's avatar Randall Leeds

Hide the widget panel until ready for input

Close #2207
parent 158030d6
...@@ -33,6 +33,7 @@ module.exports = class Host extends Guest ...@@ -33,6 +33,7 @@ module.exports = class Host extends Guest
.attr('src', src) .attr('src', src)
@frame = $('<div></div>') @frame = $('<div></div>')
.css('display', 'none')
.addClass('annotator-frame annotator-outer annotator-collapsed') .addClass('annotator-frame annotator-outer annotator-collapsed')
.appendTo(element) .appendTo(element)
...@@ -53,6 +54,9 @@ module.exports = class Host extends Guest ...@@ -53,6 +54,9 @@ module.exports = class Host extends Guest
# these events and the UI will be out of sync. # these events and the UI will be out of sync.
this.publish('setVisibleHighlights', !!options.showHighlights) this.publish('setVisibleHighlights', !!options.showHighlights)
# Time to actually show the UI
@frame.css('display', '')
if @plugins.BucketBar? if @plugins.BucketBar?
this._setupGestures() this._setupGestures()
@plugins.BucketBar.element.on 'click', (event) => @plugins.BucketBar.element.on 'click', (event) =>
......
...@@ -26,6 +26,16 @@ describe 'Host', -> ...@@ -26,6 +26,16 @@ describe 'Host', ->
afterEach -> sandbox.restore() afterEach -> sandbox.restore()
describe 'widget visibility', ->
it 'starts hidden', ->
host = createHost()
assert.equal(host.frame.css('display'), 'none')
it 'becomes visible when the "panelReady" event fires', ->
host = createHost()
host.publish('panelReady')
assert.equal(host.frame.css('display'), '')
describe 'options', -> describe 'options', ->
it 'enables highlighting when showHighlights option is provided', (done) -> it 'enables highlighting when showHighlights option is provided', (done) ->
host = createHost(showHighlights: true) host = createHost(showHighlights: true)
......
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