diff options
author | 2018-10-14 16:28:24 +0200 | |
---|---|---|
committer | 2018-10-21 11:53:17 -0700 | |
commit | 8c65c78904225e92df045cac43700210936ca148 (patch) | |
tree | d98749eab3757161d9961bed5226e05e0eea1163 /ui/static/js/nav_handler.js | |
parent | 74c35ad000a09d689e501f5995a109708fb4ff00 (diff) |
NavHandler: Make "g f" go to feed, or list of feeds
When you're reading an entry, you may want to go to the feed first,
before quickly continuing to reading all of the feeds with another "g
f".
Diffstat (limited to 'ui/static/js/nav_handler.js')
-rw-r--r-- | ui/static/js/nav_handler.js | 15 |
1 files changed, 15 insertions, 0 deletions
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; } |