Make the "open" keyboard shortcut work faster

Previously when pressing the `O` key on article list, the handler for
that keypress first simulated a click on that event in order to mark
it as read, and only then opened the website that item links to in
another tab. When having a lot of items on screen this caused a huge
delay between pressing `O` and opening the linked article in a new
tab. The delay was sometimes 5, even 10 whole seconds. This simple fix
makes it so the article opens first, and then the click simulation
happens afterwards.

Signed-off-by: Kuba Orlik <kontakt@kuba-orlik.name>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
This commit is contained in:
Kuba Orlik 2023-01-28 11:45:58 +01:00 committed by Benjamin Brahmer
parent c8800fcbc2
commit a0ab07fdb9
1 changed files with 1 additions and 1 deletions

View File

@ -259,10 +259,10 @@
var openLink = function () {
onActiveItem(function (item) {
item.trigger('click'); // mark read
var url = item.find('.external:visible').attr('href');
var newWindow = window.open(url, '_blank');
newWindow.opener = null;
setTimeout(()=>item.trigger('click'), 0); // mark read
});
};