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:
parent
9d08139f43
commit
98206059fc
2 changed files with 9 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue