mirror of
https://github.com/glanceapp/glance.git
synced 2024-11-28 19:35:00 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
openURLInNewTab(title.dataset.titleUrl);
|
openURLInNewTab(title.dataset.titleUrl, false);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,8 @@ export function clamp(value, min, max) {
|
|||||||
return Math.min(Math.max(value, min), max);
|
return Math.min(Math.max(value, min), max);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function openURLInNewTab(url) {
|
export function openURLInNewTab(url, focus = true) {
|
||||||
window.open(url, '_blank', 'noopener,noreferrer')?.focus();
|
const newWindow = window.open(url, '_blank', 'noopener,noreferrer');
|
||||||
|
|
||||||
|
if (focus && newWindow != null) newWindow.focus();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user