summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-12-05 17:00:02 +0300
committerAndrew Dolgov <[email protected]>2019-12-05 17:00:17 +0300
commit1902a7dcb0d4b0fc00a1c2ed86f4b8ab757f4508 (patch)
treefeded37649207e0867079a94b946fdb6ca9729b0 /js
parentf30287be652295d18e632316a66866697c26638c (diff)
pgup/pgdown hotkey normalization:
- pgup/pgdown without modifier scroll headline buffer - shift+pgup/pgdown work similarly to shift+up/down but operating on pages
Diffstat (limited to 'js')
-rw-r--r--js/Article.js2
-rwxr-xr-xjs/Headlines.js6
-rw-r--r--js/tt-rss.js10
3 files changed, 15 insertions, 3 deletions
diff --git a/js/Article.js b/js/Article.js
index e40e1fca0..1135fde02 100644
--- a/js/Article.js
+++ b/js/Article.js
@@ -314,7 +314,7 @@ define(["dojo/_base/declare"], function (declare) {
else
return 0;
},
- scrollPages: function (offset) {
+ scrollByPages: function (offset) {
if (!App.isCombinedMode()) {
const ci = $("content-insert");
if (ci) {
diff --git a/js/Headlines.js b/js/Headlines.js
index 3c98bef6c..4382e04f7 100755
--- a/js/Headlines.js
+++ b/js/Headlines.js
@@ -1381,6 +1381,12 @@ define(["dojo/_base/declare"], function (declare) {
}
},
+ scrollByPages: function (offset) {
+ const hi = $("headlines-frame");
+ if (hi) {
+ hi.scrollTop += hi.offsetHeight * offset * 0.9;
+ }
+ },
initHeadlinesMenu: function () {
if (!dijit.byId("headlinesMenu")) {
diff --git a/js/tt-rss.js b/js/tt-rss.js
index 43d057199..f5444207d 100644
--- a/js/tt-rss.js
+++ b/js/tt-rss.js
@@ -330,11 +330,17 @@ require(["dojo/_base/kernel",
this.hotkey_actions["article_scroll_up"] = function () {
Article.scroll(-40);
};
+ this.hotkey_actions["next_article_page"] = function () {
+ Headlines.scrollByPages(1);
+ };
+ this.hotkey_actions["prev_article_page"] = function () {
+ Headlines.scrollByPages(-1);
+ };
this.hotkey_actions["article_page_down"] = function () {
- Article.scrollPages(1);
+ Article.scrollByPages(1);
};
this.hotkey_actions["article_page_up"] = function () {
- Article.scrollPages(-1);
+ Article.scrollByPages(-1);
};
this.hotkey_actions["close_article"] = function () {
if (App.isCombinedMode()) {