From d2db81a5f67dfc13bab7cf379d1182f7aa794eb1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 19 Mar 2013 19:13:56 +0400 Subject: [PATCH] improve hotkey buffer scrolling speed; bind viewport scrolling to shift-arrows --- include/functions.php | 2 ++ js/tt-rss.js | 8 ++++++-- js/viewfeed.js | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/functions.php b/include/functions.php index d1743af7..4eff1149 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1946,6 +1946,8 @@ "c n" => "catchup_above", "*n" => "article_scroll_down", "*p" => "article_scroll_up", + "*(38)|Shift+up" => "article_scroll_up", + "*(40)|Shift+down" => "article_scroll_down", "a *w" => "toggle_widescreen", "e" => "email_article", "a q" => "close_article", diff --git a/js/tt-rss.js b/js/tt-rss.js index a8552d17..e9bc9d41 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -659,10 +659,14 @@ function hotkey_handler(e) { catchupRelativeToArticle(0); return false; case "article_scroll_down": - scrollArticle(50); + var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame"); + + scrollArticle(ctr.offsetHeight/3); return false; case "article_scroll_up": - scrollArticle(-50); + var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame"); + + scrollArticle(-ctr.offsetHeight/3); return false; case "close_article": closeArticlePanel(); diff --git a/js/viewfeed.js b/js/viewfeed.js index 622a8109..9a16beff 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -560,11 +560,11 @@ function moveToPost(mode, noscroll) { var ctr = $("headlines-frame"); if (!noscroll && article && article.offsetTop < ctr.scrollTop) { - scrollArticle(-ctr.offsetHeight/2); + scrollArticle(-ctr.offsetHeight/3); } else if (!noscroll && prev_article && prev_article.offsetTop < ctr.scrollTop) { cdmExpandArticle(prev_id); - scrollArticle(-ctr.offsetHeight/2); + scrollArticle(-ctr.offsetHeight/3); } else if (prev_id) { cdmExpandArticle(prev_id); cdmScrollToArticleId(prev_id, noscroll); -- 2.39.5