diff options
author | Andrew Dolgov <[email protected]> | 2013-02-27 18:44:45 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-02-27 18:44:45 +0400 |
commit | 3af9dbd350163a5761f58802cbca07a6d12f9206 (patch) | |
tree | de5c251299e696474b41923776394245943fc58e | |
parent | cb0810962c30b0adfc818dfdbd53cc5fe3893dcc (diff) |
cdmScrollToArticleId: use more natural scrolling
-rw-r--r-- | js/viewfeed.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js index 2f1ba24e0..07af91a67 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); |