Commit 6edf26fb authored by Aron Carroll's avatar Aron Carroll

Swap AnnotationUISync methods for toggling annotations

These were the wrong way around.
parent 07db5c12
...@@ -34,13 +34,13 @@ class AnnotationUISync ...@@ -34,13 +34,13 @@ class AnnotationUISync
showAnnotations: (ctx, tags=[]) -> showAnnotations: (ctx, tags=[]) ->
show() show()
annotations = getAnnotationsByTags(tags) annotations = getAnnotationsByTags(tags)
annotationUI.xorSelectedAnnotations(annotations) annotationUI.selectAnnotations(annotations)
focusAnnotations: (ctx, tags=[]) -> focusAnnotations: (ctx, tags=[]) ->
annotations = getAnnotationsByTags(tags) annotations = getAnnotationsByTags(tags)
annotationUI.focusAnnotations(annotations) annotationUI.focusAnnotations(annotations)
toggleAnnotationSelection: (ctx, tags=[]) -> toggleAnnotationSelection: (ctx, tags=[]) ->
annotations = getAnnotationsByTags(tags) annotations = getAnnotationsByTags(tags)
annotationUI.selectAnnotations(annotations) annotationUI.xorSelectedAnnotations(annotations)
setTool: (ctx, name) -> setTool: (ctx, name) ->
annotationUI.tool = name annotationUI.tool = name
bridge.notify(method: 'setTool', params: name) bridge.notify(method: 'setTool', params: name)
......
...@@ -109,8 +109,8 @@ describe 'AnnotationUISync', -> ...@@ -109,8 +109,8 @@ describe 'AnnotationUISync', ->
method: 'showAnnotations', method: 'showAnnotations',
params: ['tag1', 'tag2', 'tag3'] params: ['tag1', 'tag2', 'tag3']
}) })
assert.called(fakeAnnotationUI.xorSelectedAnnotations) assert.called(fakeAnnotationUI.selectAnnotations)
assert.calledWith(fakeAnnotationUI.xorSelectedAnnotations, [ assert.calledWith(fakeAnnotationUI.selectAnnotations, [
{id: 1}, {id: 2}, {id: 3} {id: 1}, {id: 2}, {id: 3}
]) ])
...@@ -133,8 +133,8 @@ describe 'AnnotationUISync', -> ...@@ -133,8 +133,8 @@ describe 'AnnotationUISync', ->
method: 'toggleAnnotationSelection', method: 'toggleAnnotationSelection',
params: ['tag1', 'tag2', 'tag3'] params: ['tag1', 'tag2', 'tag3']
}) })
assert.called(fakeAnnotationUI.selectAnnotations) assert.called(fakeAnnotationUI.xorSelectedAnnotations)
assert.calledWith(fakeAnnotationUI.selectAnnotations, [ assert.calledWith(fakeAnnotationUI.xorSelectedAnnotations, [
{id: 1}, {id: 2}, {id: 3} {id: 1}, {id: 2}, {id: 3}
]) ])
......
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