post-hover.js: show a popup preview if a reply is only partially on screen; fixes ctrlcctrlv#84

This commit is contained in:
czaks 2014-09-26 12:56:05 +02:00
parent f71cdcaa81
commit ba515c5f05

View File

@ -58,8 +58,8 @@ onready(function(){
// link links to itself or to op; ignore
}
else if($post.is(':visible') &&
$post.offset().top + $post.height() >= $(window).scrollTop() &&
$post.offset().top <= $(window).scrollTop() + $(window).height()) {
$post.offset().top >= $(window).scrollTop() &&
$post.offset().top + $post.height() <= $(window).scrollTop() + $(window).height()) {
// post is in view
$post.addClass('highlighted');
} else {