mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 06:35:55 +00:00
implement keyboard-related changes discussed in https://community.tt-rss.org/t/changing-the-amount-of-scroll-by-arrow-key/3452/7
This commit is contained in:
40
js/tt-rss.js
40
js/tt-rss.js
@@ -285,10 +285,16 @@ require(["dojo/_base/kernel",
|
||||
if (rv) Feeds.open({feed: rv[0], is_cat: rv[1], delayed: true})
|
||||
};
|
||||
this.hotkey_actions["next_article_or_scroll"] = function (event) {
|
||||
Headlines.move('next', {event: event});
|
||||
if (App.isCombinedMode())
|
||||
Headlines.scroll(Headlines.line_scroll_offset, event);
|
||||
else
|
||||
Headlines.move('next', {event: event});
|
||||
};
|
||||
this.hotkey_actions["prev_article_or_scroll"] = function (event) {
|
||||
Headlines.move('prev', {event: event});
|
||||
if (App.isCombinedMode())
|
||||
Headlines.scroll(-Headlines.line_scroll_offset, event);
|
||||
else
|
||||
Headlines.move('prev', {event: event});
|
||||
};
|
||||
this.hotkey_actions["next_article_noscroll"] = function (event) {
|
||||
Headlines.move('next', {noscroll: true, event: event});
|
||||
@@ -335,28 +341,34 @@ require(["dojo/_base/kernel",
|
||||
Headlines.catchupRelativeTo(0);
|
||||
};
|
||||
this.hotkey_actions["article_scroll_down"] = function (event) {
|
||||
const ctr = App.isCombinedMode() ? $("headlines-frame") : $("content-insert");
|
||||
|
||||
if (ctr)
|
||||
Article.scroll(ctr.offsetHeight / 2, event);
|
||||
if (App.isCombinedMode())
|
||||
Headlines.scroll(Headlines.line_scroll_offset, event);
|
||||
else
|
||||
Article.scroll(Headlines.line_scroll_offset, event);
|
||||
};
|
||||
this.hotkey_actions["article_scroll_up"] = function (event) {
|
||||
const ctr = App.isCombinedMode() ? $("headlines-frame") : $("content-insert");
|
||||
|
||||
if (ctr)
|
||||
Article.scroll(-ctr.offsetHeight / 2, event);
|
||||
if (App.isCombinedMode())
|
||||
Headlines.scroll(-Headlines.line_scroll_offset, event);
|
||||
else
|
||||
Article.scroll(-Headlines.line_scroll_offset, event);
|
||||
};
|
||||
this.hotkey_actions["next_article_page"] = function (event) {
|
||||
this.hotkey_actions["next_headlines_page"] = function (event) {
|
||||
Headlines.scrollByPages(1, event);
|
||||
};
|
||||
this.hotkey_actions["prev_article_page"] = function (event) {
|
||||
this.hotkey_actions["prev_headlines_page"] = function (event) {
|
||||
Headlines.scrollByPages(-1, event);
|
||||
};
|
||||
this.hotkey_actions["article_page_down"] = function (event) {
|
||||
Article.scrollByPages(1, event);
|
||||
if (App.isCombinedMode())
|
||||
Headlines.scrollByPages(1, event);
|
||||
else
|
||||
Article.scrollByPages(1, event);
|
||||
};
|
||||
this.hotkey_actions["article_page_up"] = function (event) {
|
||||
Article.scrollByPages(-1, event);
|
||||
if (App.isCombinedMode())
|
||||
Headlines.scrollByPages(-1, event);
|
||||
else
|
||||
Article.scrollByPages(-1, event);
|
||||
};
|
||||
this.hotkey_actions["close_article"] = function () {
|
||||
if (App.isCombinedMode()) {
|
||||
|
||||
Reference in New Issue
Block a user