Commit 93590fd6 authored by gergely-ujvari's avatar gergely-ujvari

Merge pull request #1506 from hypothesis/1502-missing-uri-property

Sync the bridge after beforeAnnotationCreated
parents 90d6d705 30bd605d
...@@ -188,7 +188,7 @@ AnnotationController = [ ...@@ -188,7 +188,7 @@ AnnotationController = [
angular.extend @annotation, angular.copy model angular.extend @annotation, angular.copy model
# Extract the document metadata. # Extract the document metadata.
if model.document and model.target.length if model.document
domain = extractURIComponent(model.uri, 'hostname') domain = extractURIComponent(model.uri, 'hostname')
@document = @document =
......
...@@ -226,6 +226,11 @@ class Annotator.Guest extends Annotator ...@@ -226,6 +226,11 @@ class Annotator.Guest extends Annotator
this.removeEvents() this.removeEvents()
createAnnotation: ->
annotation = super
this.plugins.Bridge.sync([annotation])
annotation
showViewer: (annotations) => showViewer: (annotations) =>
@panel?.notify @panel?.notify
method: "showViewer" method: "showViewer"
......
...@@ -65,12 +65,6 @@ describe 'h.directives.annotation', -> ...@@ -65,12 +65,6 @@ describe 'h.directives.annotation', ->
$scope.$digest() $scope.$digest()
assert.isNull(controller.document) assert.isNull(controller.document)
it 'skips the document object if the annotation has no targets', ->
annotation.target = []
controller = createController()
$scope.$digest()
assert.isNull(controller.document)
describe '#reply', -> describe '#reply', ->
controller = null controller = null
container = null container = null
......
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