From a0ab07fdb9e32e53cbcf483da312bdd91de4280b Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Sat, 28 Jan 2023 11:45:58 +0100 Subject: 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 Signed-off-by: Benjamin Brahmer --- js/gui/KeyboardShortcuts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }); }; -- cgit v1.2.3