Commit 49515e57 authored by csillag's avatar csillag

Moved showViewer and updateViewer out of the bridge plugin

parent 109c1b97
......@@ -309,8 +309,12 @@ class Annotator.Host extends Annotator
'margin-left': "#{m}px"
width: "#{w}px"
showViewer: (annotations) => @plugins.Bridge.showViewer annotations
updateViewer: (annotations) => @plugins.Bridge.updateViewer annotations
showViewer: (annotations) =>
@panel?.notify method: "showViewer", params: (a.id for a in annotations)
updateViewer: (annotations) =>
@panel?.notify method: "updateViewer", params: (a.id for a in annotations)
showEditor: (annotation) => @plugins.Bridge.showEditor annotation
checkForStartSelection: (event) =>
......
......@@ -124,14 +124,6 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin
@annotator.showEditor (this._parse annotation)
)
.bind('showViewer', (ctx, annotations) =>
@annotator.showViewer (this._parse a for a in annotations)
)
.bind('updateViewer', (ctx, annotations) =>
@annotator.updateViewer (this._parse a for a in annotations)
)
.bind('injectAnnotation', (ctx, annotation) =>
a = this._parse annotation
......@@ -189,18 +181,6 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin
params: this._format annotation
this
showViewer: (annotations) ->
@channel.notify
method: 'showViewer'
params: (this._format a for a in annotations)
this
updateViewer: (annotations) ->
@channel.notify
method: 'updateViewer'
params: (this._format a for a in annotations)
this
injectAnnotation: (annotation) ->
@channel.notify
method: 'injectAnnotation'
......
......@@ -198,6 +198,14 @@ class Hypothesis extends Annotator
# Pop out the sidebar
$rootScope.$apply => this.show())
.bind('showViewer', (ctx, ids) =>
this.showViewer ((@threading.getContainer id).message for id in ids)
)
.bind('updateViewer', (ctx, ids) =>
this.updateViewer ((@threading.getContainer id).message for id in ids)
)
_setupWrapper: ->
@wrapper = @element.find('#wrapper')
.on 'mousewheel', (event, delta) ->
......
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