Commit c2fda671 authored by csillag's avatar csillag

When opening an annotation card, scroll to highlight. (As in #787)

parent 23d6d82c
......@@ -724,6 +724,11 @@ class Viewer
method: 'setActiveHighlights'
params: highlights
$scope.openDetails = (annotation) ->
for p in providers
p.channel.notify
method: 'scrollTo'
params: annotation.$$tag
class Search
this.$inject = ['$filter', '$location', '$routeParams', '$scope', 'annotator']
......
......@@ -217,6 +217,7 @@ thread = ['$timeout', ($timeout) ->
$timeout ->
return unless Object.keys(childrenEditing).length is 0
scope.collapsed = !scope.collapsed
scope.openDetails scope.annotation unless scope.collapsed
, 10
scope.$on 'toggleEditing', (event) ->
......
......@@ -68,6 +68,13 @@ class Annotator.Guest extends Annotator
$(this).removeClass('annotator-hl-active')
)
.bind('scrollTo', (ctx, tag) =>
@wrapper.find('.annotator-hl')
.each ->
if $(this).data('annotation').$$tag is tag
$(this).scrollintoview()
)
.bind('adderClick', =>
@onAdderClick @event
)
......
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