v1.18.x
barisusakli 9 years ago
parent 80c98e5ecf
commit a9e4add8d2

@ -227,12 +227,10 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com
}; };
navigator.scrollToPostIndex = function(postIndex, highlight, duration) { navigator.scrollToPostIndex = function(postIndex, highlight, duration) {
var scrollTo = components.get('post/anchor', postIndex), var scrollTo = components.get('post', 'index', postIndex);
postEl = components.get('post', 'index', postIndex), var postHeight = scrollTo.height();
postHeight = postEl.height(), var viewportHeight = $(window).height();
viewportHeight = $(window).height(), var navbarHeight = components.get('navbar').height();
navbarHeight = components.get('navbar').height();
if (!scrollTo.length) { if (!scrollTo.length) {
navigator.scrollActive = false; navigator.scrollActive = false;
@ -275,9 +273,9 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com
function highlightPost() { function highlightPost() {
if (highlight) { if (highlight) {
scrollTo.parents('[component="post"]').addClass('highlight'); scrollTo.addClass('highlight');
setTimeout(function() { setTimeout(function() {
scrollTo.parents('[component="post"]').removeClass('highlight'); scrollTo.removeClass('highlight');
}, 10000); }, 10000);
} }
} }

Loading…
Cancel
Save