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

Host is in charge of the frame

parent 1a2b0004
...@@ -48,10 +48,6 @@ module.exports = class Guest extends Annotator ...@@ -48,10 +48,6 @@ module.exports = class Guest extends Annotator
# let's load the Document plugin instead. # let's load the Document plugin instead.
@options.Document = {} @options.Document = {}
@frame = $('<div></div>')
.appendTo(@wrapper)
.addClass('annotator-frame annotator-outer annotator-collapsed')
delete @options.app delete @options.app
cfOptions = cfOptions =
...@@ -202,7 +198,6 @@ module.exports = class Guest extends Annotator ...@@ -202,7 +198,6 @@ module.exports = class Guest extends Annotator
$('#annotator-dynamic-style').remove() $('#annotator-dynamic-style').remove()
@adder.remove() @adder.remove()
@frame.remove()
@wrapper.find('.annotator-hl').each -> @wrapper.find('.annotator-hl').each ->
$(this).contents().insertBefore(this) $(this).contents().insertBefore(this)
......
...@@ -31,6 +31,10 @@ module.exports = class Host extends Guest ...@@ -31,6 +31,10 @@ module.exports = class Host extends Guest
.attr('seamless', '') .attr('seamless', '')
.attr('src', src) .attr('src', src)
@frame = $('<div></div>')
.addClass('annotator-frame annotator-outer annotator-collapsed')
.appendTo(element)
super element, options, dontScan: true super element, options, dontScan: true
this._addCrossFrameListeners() this._addCrossFrameListeners()
...@@ -54,6 +58,10 @@ module.exports = class Host extends Guest ...@@ -54,6 +58,10 @@ module.exports = class Host extends Guest
if @frame.hasClass 'annotator-collapsed' if @frame.hasClass 'annotator-collapsed'
this.showFrame() this.showFrame()
destroy: ->
@frame.remove()
super
showFrame: (options={transition: true}) -> showFrame: (options={transition: true}) ->
unless @drag.enabled unless @drag.enabled
@frame.css 'margin-left': "#{-1 * @frame.width()}px" @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