mirror of
https://github.com/chylex/Nextcloud-News.git
synced 2025-04-26 05:15:46 +02:00
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:
parent
c8800fcbc2
commit
a0ab07fdb9
@ -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
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user