pgup/pgdown hotkey normalization:

- pgup/pgdown without modifier scroll headline buffer
- shift+pgup/pgdown work similarly to shift+up/down but operating on pages
master
Andrew Dolgov 5 years ago
parent f30287be65
commit 1902a7dcb0

@ -1114,14 +1114,16 @@
"j" => "prev_feed", "j" => "prev_feed",
"n" => "next_article", "n" => "next_article",
"p" => "prev_article", "p" => "prev_article",
"(33)|PageUp" => "prev_article_page",
"(34)|PageDown" => "next_article_page",
"(38)|Up" => "prev_article", "(38)|Up" => "prev_article",
"(40)|Down" => "next_article", "(40)|Down" => "next_article",
"*(38)|Shift+Up" => "article_scroll_up", "*(38)|Shift+Up" => "article_scroll_up",
"*(40)|Shift+Down" => "article_scroll_down", "*(40)|Shift+Down" => "article_scroll_down",
"^(38)|Ctrl+Up" => "prev_article_noscroll", "^(38)|Ctrl+Up" => "prev_article_noscroll",
"^(40)|Ctrl+Down" => "next_article_noscroll", "^(40)|Ctrl+Down" => "next_article_noscroll",
"(33)|Page Up" => "article_page_up", "^(33)|Shift+PageUp" => "article_page_up",
"(34)|Page Down" => "article_page_down", "^(34)|Shift+PageDown" => "article_page_down",
"/" => "search_dialog", "/" => "search_dialog",
"s" => "toggle_mark", "s" => "toggle_mark",
"S" => "toggle_publ", "S" => "toggle_publ",

@ -314,7 +314,7 @@ define(["dojo/_base/declare"], function (declare) {
else else
return 0; return 0;
}, },
scrollPages: function (offset) { scrollByPages: function (offset) {
if (!App.isCombinedMode()) { if (!App.isCombinedMode()) {
const ci = $("content-insert"); const ci = $("content-insert");
if (ci) { if (ci) {

@ -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 () { initHeadlinesMenu: function () {
if (!dijit.byId("headlinesMenu")) { if (!dijit.byId("headlinesMenu")) {

@ -330,11 +330,17 @@ require(["dojo/_base/kernel",
this.hotkey_actions["article_scroll_up"] = function () { this.hotkey_actions["article_scroll_up"] = function () {
Article.scroll(-40); 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 () { this.hotkey_actions["article_page_down"] = function () {
Article.scrollPages(1); Article.scrollByPages(1);
}; };
this.hotkey_actions["article_page_up"] = function () { this.hotkey_actions["article_page_up"] = function () {
Article.scrollPages(-1); Article.scrollByPages(-1);
}; };
this.hotkey_actions["close_article"] = function () { this.hotkey_actions["close_article"] = function () {
if (App.isCombinedMode()) { if (App.isCombinedMode()) {

Loading…
Cancel
Save