summaryrefslogtreecommitdiff
path: root/js/Article.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-12-11 06:53:32 +0300
committerAndrew Dolgov <[email protected]>2019-12-11 06:53:32 +0300
commit0a10832491b1505bd8762d5c70feb198f4d2c757 (patch)
treead84784e646c86a92b41cc1b23eef5ac3b36e7a0 /js/Article.js
parent985e11b75421d3322dcca7ae52bfdb607558dee0 (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/Article.js')
-rw-r--r--js/Article.js16
1 files changed, 2 insertions, 14 deletions
diff --git a/js/Article.js b/js/Article.js
index 11e0305a7..08b565695 100644
--- a/js/Article.js
+++ b/js/Article.js
@@ -329,13 +329,7 @@ define(["dojo/_base/declare"], function (declare) {
return 0;
},
scrollByPages: function (page_offset, event) {
- let elem;
-
- if (!App.isCombinedMode()) {
- elem = $("content-insert");
- } else {
- elem = $("headlines-frame");
- }
+ const elem = App.isCombinedMode() ? $("headlines-frame") : $("content-insert");
const offset = elem.offsetHeight * page_offset * 0.99;
@@ -343,13 +337,7 @@ define(["dojo/_base/declare"], function (declare) {
},
scroll: function (offset, event) {
- let elem;
-
- if (!App.isCombinedMode()) {
- elem = $("content-insert");
- } else {
- elem = $("headlines-frame");
- }
+ const elem = App.isCombinedMode() ? $("headlines-frame") : $("content-insert");
if (event && event.repeat) {
elem.addClassName("forbid-smooth-scroll");