diff options
author | Kuba Orlik <kontakt@kuba-orlik.name> | 2023-01-28 11:45:58 +0100 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2023-01-29 19:14:30 +0100 |
commit | a0ab07fdb9e32e53cbcf483da312bdd91de4280b (patch) | |
tree | e9d8fd0323a0ab9a4de4285a2725b77aff8baf96 | |
parent | c8800fcbc2cc79494f547231313692aca4046b29 (diff) |
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>
-rw-r--r-- | js/gui/KeyboardShortcuts.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/js/gui/KeyboardShortcuts.js b/js/gui/KeyboardShortcuts.js index 9ddcb582d..3cb174e00 100644 --- a/js/gui/KeyboardShortcuts.js +++ b/js/gui/KeyboardShortcuts.js @@ -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 }); }; |