1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-10 12:09:15 +00:00

pgup/pgdown hotkey normalization:

- pgup/pgdown without modifier scroll headline buffer
- shift+pgup/pgdown work similarly to shift+up/down but operating on pages
This commit is contained in:
Andrew Dolgov
2019-12-05 17:00:02 +03:00
parent f30287be65
commit 1902a7dcb0
4 changed files with 19 additions and 5 deletions

View File

@@ -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) {

View File

@@ -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")) {

View File

@@ -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()) {