From a9e4add8d2db1a58016b6c4f9a426497ca1c9cff Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 30 Aug 2016 14:25:24 +0300 Subject: [PATCH] closes #4998 --- public/src/modules/navigator.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js index 93dc81ff06..ffc397bca0 100644 --- a/public/src/modules/navigator.js +++ b/public/src/modules/navigator.js @@ -227,12 +227,10 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com }; navigator.scrollToPostIndex = function(postIndex, highlight, duration) { - var scrollTo = components.get('post/anchor', postIndex), - postEl = components.get('post', 'index', postIndex), - postHeight = postEl.height(), - viewportHeight = $(window).height(), - navbarHeight = components.get('navbar').height(); - + var scrollTo = components.get('post', 'index', postIndex); + var postHeight = scrollTo.height(); + var viewportHeight = $(window).height(); + var navbarHeight = components.get('navbar').height(); if (!scrollTo.length) { navigator.scrollActive = false; @@ -275,9 +273,9 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com function highlightPost() { if (highlight) { - scrollTo.parents('[component="post"]').addClass('highlight'); + scrollTo.addClass('highlight'); setTimeout(function() { - scrollTo.parents('[component="post"]').removeClass('highlight'); + scrollTo.removeClass('highlight'); }, 10000); } }