mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 18:06:02 +00:00
- 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
This commit is contained in:
@@ -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");
|
||||
|
||||
18
js/tt-rss.js
18
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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user