X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/573b9004c7bc2a6a2b29335155b4ff55d142c6b6..fd28890ac78d5869ac68ec6db7183bc168d03891:/src/redakcja/static/js/wiki/view_annotations.js diff --git a/src/redakcja/static/js/wiki/view_annotations.js b/src/redakcja/static/js/wiki/view_annotations.js index 97479cd0..8e3671ab 100644 --- a/src/redakcja/static/js/wiki/view_annotations.js +++ b/src/redakcja/static/js/wiki/view_annotations.js @@ -32,7 +32,7 @@ } updateAnnotationIds() { - let selt = this; + let self = this; self.annotationToAnchor = {}; $('#html-view').find('.annotation-inline-box').each( function(i, annoBox) { @@ -65,9 +65,10 @@ var anchor = self.annotationToAnchor[content]; if (anchor != undefined) { var $htmlView = $("#html-view"); - var top = $htmlView.offset().top + - $("[name=" + anchor + "]", $htmlView).offset().top - - $htmlView.children().eq(0).offset().top; + var top = $("[name=" + anchor + "]", $htmlView).offset().top - + $htmlView.offset().top + + $htmlView.scrollTop() + ; $htmlView.animate({scrollTop: top}, 250); }