Commit 5ab492e4 authored by Sean Roberts's avatar Sean Roberts Committed by GitHub

Merge pull request #136 from hypothesis/fix-direct-link-scroll

Fix scrolling to direct-linked annotations
parents 36ab62bf d61ba101
...@@ -271,7 +271,7 @@ describe('WidgetController', function () { ...@@ -271,7 +271,7 @@ describe('WidgetController', function () {
}; };
annotationUI.addAnnotations([annot]); annotationUI.addAnnotations([annot]);
$scope.$digest(); $scope.$digest();
$rootScope.$broadcast(events.ANNOTATIONS_SYNCED, [{tag: 'atag'}]); $rootScope.$broadcast(events.ANNOTATIONS_SYNCED, ['atag']);
assert.calledWith(fakeFrameSync.focusAnnotations, ['atag']); assert.calledWith(fakeFrameSync.focusAnnotations, ['atag']);
assert.calledWith(fakeFrameSync.scrollToAnnotation, 'atag'); assert.calledWith(fakeFrameSync.scrollToAnnotation, 'atag');
}); });
......
...@@ -241,7 +241,7 @@ module.exports = function WidgetController( ...@@ -241,7 +241,7 @@ module.exports = function WidgetController(
return; return;
} }
var matchesSelection = tags.some(function (tag) { var matchesSelection = tags.some(function (tag) {
return tag.tag === selectedAnnot.$$tag; return tag === selectedAnnot.$$tag;
}); });
if (!matchesSelection) { if (!matchesSelection) {
return; 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