mirror of
https://github.com/glanceapp/glance.git
synced 2024-11-25 01:44:47 +01:00
Don't focus new tab on middle click
This is more in line with how the browser behaves on middle click
This commit is contained in:
parent
af4c1e8514
commit
afe6ad6bfc
@ -262,7 +262,7 @@ function setupGroups() {
|
||||
return;
|
||||
}
|
||||
|
||||
openURLInNewTab(title.dataset.titleUrl);
|
||||
openURLInNewTab(title.dataset.titleUrl, false);
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
|
@ -28,6 +28,8 @@ export function clamp(value, min, max) {
|
||||
return Math.min(Math.max(value, min), max);
|
||||
}
|
||||
|
||||
export function openURLInNewTab(url) {
|
||||
window.open(url, '_blank', 'noopener,noreferrer')?.focus();
|
||||
export function openURLInNewTab(url, focus = true) {
|
||||
const newWindow = window.open(url, '_blank', 'noopener,noreferrer');
|
||||
|
||||
if (focus && newWindow != null) newWindow.focus();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user