diff options
author | Diego Agulló <aeoris@gmail.com> | 2018-10-02 05:52:51 +0200 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-10-01 20:52:51 -0700 |
commit | 98206059fc55e68b3b0f8c95b74c331dd56da84c (patch) | |
tree | 08b5ab6941463356e05bc431e50ca81ec07f972a /ui/static/js | |
parent | 9d08139f4363d3503398002bc82cb3746e3438cf (diff) |
Set focus on article link when pressing prev/next hotkeys
This enhancement offer the possibility to open articles in the background by using the browser hotkey Ctrl+Return or Cmd+Return.
Diffstat (limited to 'ui/static/js')
-rw-r--r-- | ui/static/js/nav_handler.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/static/js/nav_handler.js b/ui/static/js/nav_handler.js index bd9c681..5d2474b 100644 --- a/ui/static/js/nav_handler.js +++ b/ui/static/js/nav_handler.js @@ -167,6 +167,7 @@ class NavHandler { if (document.querySelector(".current-item") === null) { items[0].classList.add("current-item"); + items[0].querySelector('.item-header a').focus(); return; } @@ -177,6 +178,7 @@ class NavHandler { if (i - 1 >= 0) { items[i - 1].classList.add("current-item"); DomHelper.scrollPageTo(items[i - 1]); + items[i - 1].querySelector('.item-header a').focus(); } break; @@ -193,6 +195,7 @@ class NavHandler { if (currentItem === null) { items[0].classList.add("current-item"); + items[0].querySelector('.item-header a').focus(); return; } @@ -203,6 +206,7 @@ class NavHandler { if (i + 1 < items.length) { items[i + 1].classList.add("current-item"); DomHelper.scrollPageTo(items[i + 1]); + items[i + 1].querySelector('.item-header a').focus(); } break; |