From 3af9dbd350163a5761f58802cbca07a6d12f9206 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 27 Feb 2013 18:44:45 +0400 Subject: [PATCH] cdmScrollToArticleId: use more natural scrolling --- js/viewfeed.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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);