1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

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.
This commit is contained in:
Diego Agulló 2018-10-02 05:52:51 +02:00 committed by Frédéric Guillot
parent 9d08139f43
commit 98206059fc
2 changed files with 9 additions and 5 deletions

View file

@ -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;