client: open links in new tab
ci/woodpecker/push/lint-client Pipeline was successful Details
ci/woodpecker/push/lint-backend Pipeline was successful Details
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/lint-sw Pipeline was successful Details
ci/woodpecker/push/test Pipeline was successful Details

If links are clicked while holding Ctrl or clicked with middle mouse
button, they will be opened in a new tab.

Changelog: Fixed
This commit is contained in:
Johann150 2023-03-31 22:19:01 +02:00
parent 1472c21cb6
commit 7914fcfef2
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 5 additions and 2 deletions

View File

@ -65,8 +65,11 @@ function onContextmenu(ev) {
}], ev);
}
function nav() {
if (props.behavior === 'browser') {
function nav(evt: MouseEvent) {
if (evt.ctrlKey || evt.buttons === 4) {
// held Control or clicked with middle mouse button
window.open(props.to, '_blank');
} else if (props.behavior === 'browser') {
location.href = props.to;
} else if (props.behavior === 'window') {
os.pageWindow(props.to);