cdmScrollToArticleId: use more natural scrolling

This commit is contained in:
Andrew Dolgov 2013-02-27 18:44:45 +04:00
parent cb0810962c
commit 3af9dbd350
1 changed files with 5 additions and 1 deletions

View File

@ -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);