diff options
Diffstat (limited to 'ui/static/js')
-rw-r--r-- | ui/static/js/bootstrap.js | 2 | ||||
-rw-r--r-- | ui/static/js/nav_handler.js | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/ui/static/js/bootstrap.js b/ui/static/js/bootstrap.js index 3c2bb35..5c0bfac 100644 --- a/ui/static/js/bootstrap.js +++ b/ui/static/js/bootstrap.js @@ -9,7 +9,7 @@ document.addEventListener("DOMContentLoaded", function() { keyboardHandler.on("g u", () => navHandler.goToPage("unread")); keyboardHandler.on("g b", () => navHandler.goToPage("starred")); keyboardHandler.on("g h", () => navHandler.goToPage("history")); - keyboardHandler.on("g f", () => navHandler.goToPage("feeds")); + keyboardHandler.on("g f", () => navHandler.goToFeedOrFeeds()); keyboardHandler.on("g c", () => navHandler.goToPage("categories")); keyboardHandler.on("g s", () => navHandler.goToPage("settings")); keyboardHandler.on("ArrowLeft", () => navHandler.goToPrevious()); diff --git a/ui/static/js/nav_handler.js b/ui/static/js/nav_handler.js index 5f611e0..dd10607 100644 --- a/ui/static/js/nav_handler.js +++ b/ui/static/js/nav_handler.js @@ -173,6 +173,17 @@ class NavHandler { } } + goToFeedOrFeeds() { + if (this.isEntry()) { + let feedAnchor = document.querySelector("span.entry-website a"); + if (feedAnchor !== null) { + window.location.href = feedAnchor.href; + } + } else { + this.goToPage('feeds'); + } + } + goToPreviousListItem() { let items = DomHelper.getVisibleElements(".items .item"); if (items.length === 0) { @@ -228,6 +239,10 @@ class NavHandler { } } + isEntry() { + return document.querySelector("section.entry") !== null; + } + isListView() { return document.querySelector(".items") !== null; } |