From: Andrew Dolgov Date: Wed, 27 Feb 2013 14:44:45 +0000 (+0400) Subject: cdmScrollToArticleId: use more natural scrolling X-Git-Tag: 1.7.1~22^2~8 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3af9dbd350163a5761f58802cbca07a6d12f9206;p=tt-rss.git cdmScrollToArticleId: use more natural scrolling --- diff --git a/js/viewfeed.js b/js/viewfeed.js index 2f1ba24e..07af91a6 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -1132,7 +1132,11 @@ function cdmScrollToArticleId(id) { if (!e || !ctr) return; - ctr.scrollTop = e.offsetTop; + if (e.offsetTop+e.offsetHeight > (ctr.scrollTop+ctr.offsetHeight) || + e.offsetTop < ctr.scrollTop) { + + ctr.scrollTop = e.offsetTop; + } } catch (e) { exception_error("cdmScrollToArticleId", e);