Commit d61ba101 authored by Robert Knight's avatar Robert Knight

Fix scrolling to direct-linked annotations

The FrameSync service introduced in 55093ebb emitted an
ANNOTATIONS_SYNCED event which unintentionally had a different type for
the `tags` argument than the previous code (`string[]`, instead of
`Array<{tag:string}>`)

This commit updates the code in WidgetController to expect `tags`
to be of type `string[]`.

Fixes #129
parent f588f1e7
......@@ -271,7 +271,7 @@ describe('WidgetController', function () {
};
annotationUI.addAnnotations([annot]);
$scope.$digest();
$rootScope.$broadcast(events.ANNOTATIONS_SYNCED, [{tag: 'atag'}]);
$rootScope.$broadcast(events.ANNOTATIONS_SYNCED, ['atag']);
assert.calledWith(fakeFrameSync.focusAnnotations, ['atag']);
assert.calledWith(fakeFrameSync.scrollToAnnotation, 'atag');
});
......
......@@ -241,7 +241,7 @@ module.exports = function WidgetController(
return;
}
var matchesSelection = tags.some(function (tag) {
return tag.tag === selectedAnnot.$$tag;
return tag === selectedAnnot.$$tag;
});
if (!matchesSelection) {
return;
......
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