diff options
author | Richard Schneider <richard@schneiderbox.net> | 2020-01-07 00:02:02 -0600 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2020-01-06 22:02:02 -0800 |
commit | 6ebb29cd22f864842bd763828e914d172ce6f46b (patch) | |
tree | f463aa6757583c0cd61793565f14a4788f0ae952 /ui/static/js/app.js | |
parent | e2315e6a54c93ff44f99482fae6a0931444dc27a (diff) |
Add comments link keyboard shortcut
Diffstat (limited to 'ui/static/js/app.js')
-rw-r--r-- | ui/static/js/app.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ui/static/js/app.js b/ui/static/js/app.js index 2b32e63..968045e 100644 --- a/ui/static/js/app.js +++ b/ui/static/js/app.js @@ -304,6 +304,25 @@ function openOriginalLink(openLinkInCurrentTab) { } } +function openCommentLink(openLinkInCurrentTab) { + if (!isListView()) { + let entryLink = document.querySelector("a[data-comments-link]"); + if (entryLink !== null) { + if (openLinkInCurrentTab) { + window.location.href = entryLink.getAttribute("href"); + } else { + DomHelper.openNewTab(entryLink.getAttribute("href")); + } + return; + } + } else { + let currentItemCommentsLink = document.querySelector(".current-item a[data-comments-link]"); + if (currentItemCommentsLink !== null) { + DomHelper.openNewTab(currentItemCommentsLink.getAttribute("href")); + } + } +} + function openSelectedItem() { let currentItemLink = document.querySelector(".current-item .item-title a"); if (currentItemLink !== null) { |