diff options
author | Andrew Dolgov <[email protected]> | 2019-12-11 06:53:32 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-12-11 06:53:32 +0300 |
commit | 0a10832491b1505bd8762d5c70feb198f4d2c757 (patch) | |
tree | ad84784e646c86a92b41cc1b23eef5ac3b36e7a0 /js/tt-rss.js | |
parent | 985e11b75421d3322dcca7ae52bfdb607558dee0 (diff) |
- 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
Diffstat (limited to 'js/tt-rss.js')
-rw-r--r-- | js/tt-rss.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/js/tt-rss.js b/js/tt-rss.js index 744034f0c..b127376c7 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -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(); } }; |