improve hotkey buffer scrolling speed; bind viewport scrolling to shift-arrows

This commit is contained in:
Andrew Dolgov 2013-03-19 19:13:56 +04:00
parent d5b82f3ebb
commit d2db81a5f6
3 changed files with 10 additions and 4 deletions

View file

@ -1946,6 +1946,8 @@
"c n" => "catchup_above", "c n" => "catchup_above",
"*n" => "article_scroll_down", "*n" => "article_scroll_down",
"*p" => "article_scroll_up", "*p" => "article_scroll_up",
"*(38)|Shift+up" => "article_scroll_up",
"*(40)|Shift+down" => "article_scroll_down",
"a *w" => "toggle_widescreen", "a *w" => "toggle_widescreen",
"e" => "email_article", "e" => "email_article",
"a q" => "close_article", "a q" => "close_article",

View file

@ -659,10 +659,14 @@ function hotkey_handler(e) {
catchupRelativeToArticle(0); catchupRelativeToArticle(0);
return false; return false;
case "article_scroll_down": case "article_scroll_down":
scrollArticle(50); var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
scrollArticle(ctr.offsetHeight/3);
return false; return false;
case "article_scroll_up": case "article_scroll_up":
scrollArticle(-50); var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
scrollArticle(-ctr.offsetHeight/3);
return false; return false;
case "close_article": case "close_article":
closeArticlePanel(); closeArticlePanel();

View file

@ -560,11 +560,11 @@ function moveToPost(mode, noscroll) {
var ctr = $("headlines-frame"); var ctr = $("headlines-frame");
if (!noscroll && article && article.offsetTop < ctr.scrollTop) { if (!noscroll && article && article.offsetTop < ctr.scrollTop) {
scrollArticle(-ctr.offsetHeight/2); scrollArticle(-ctr.offsetHeight/3);
} else if (!noscroll && prev_article && } else if (!noscroll && prev_article &&
prev_article.offsetTop < ctr.scrollTop) { prev_article.offsetTop < ctr.scrollTop) {
cdmExpandArticle(prev_id); cdmExpandArticle(prev_id);
scrollArticle(-ctr.offsetHeight/2); scrollArticle(-ctr.offsetHeight/3);
} else if (prev_id) { } else if (prev_id) {
cdmExpandArticle(prev_id); cdmExpandArticle(prev_id);
cdmScrollToArticleId(prev_id, noscroll); cdmScrollToArticleId(prev_id, noscroll);