1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 06:35:55 +00:00

- update descriptions of changed hotkeys

- bind noscroll variants of move article hotkeys to n/p by default
- update N/P (i.e. scroll article content) hotkeys to scroll by fraction of viewport height instead of hardcoded pixel distance
- minor fixes w/ checking for undefined
This commit is contained in:
Andrew Dolgov
2019-12-11 06:53:32 +03:00
parent 985e11b754
commit 0a10832491
3 changed files with 24 additions and 30 deletions

View File

@@ -277,10 +277,10 @@ require(["dojo/_base/kernel",
if (rv) Feeds.open({feed: rv[0], is_cat: rv[1], delayed: true})
};
this.hotkey_actions["next_article"] = function (event) {
this.hotkey_actions["next_article_or_scroll"] = function (event) {
Headlines.move('next', {event: event});
};
this.hotkey_actions["prev_article"] = function (event) {
this.hotkey_actions["prev_article_or_scroll"] = function (event) {
Headlines.move('prev', {event: event});
};
this.hotkey_actions["next_article_noscroll"] = function (event) {
@@ -325,10 +325,16 @@ require(["dojo/_base/kernel",
Headlines.catchupRelativeTo(0);
};
this.hotkey_actions["article_scroll_down"] = function (event) {
Article.scroll(80, event);
const ctr = App.isCombinedMode() ? $("headlines-frame") : $("content-insert");
if (ctr)
Article.scroll(ctr.offsetHeight / 2, event);
};
this.hotkey_actions["article_scroll_up"] = function (event) {
Article.scroll(-80, event);
const ctr = App.isCombinedMode() ? $("headlines-frame") : $("content-insert");
if (ctr)
Article.scroll(-ctr.offsetHeight / 2, event);
};
this.hotkey_actions["next_article_page"] = function (event) {
Headlines.scrollByPages(1, event);
@@ -375,7 +381,7 @@ require(["dojo/_base/kernel",
Headlines.select('none');
};
this.hotkey_actions["feed_refresh"] = function () {
if (Feeds.getActive() != undefined) {
if (typeof Feeds.getActive() != "undefined") {
Feeds.open({feed: Feeds.getActive(), is_cat: Feeds.activeIsCat()});
}
};
@@ -405,7 +411,7 @@ require(["dojo/_base/kernel",
CommonDialogs.editFeed(Feeds.getActive());
};
this.hotkey_actions["feed_catchup"] = function () {
if (Feeds.getActive() != undefined) {
if (typeof Feeds.getActive() != "undefined") {
Feeds.catchupCurrent();
}
};