Skip to content

Commit

Permalink
Merge pull request #4800 from FlowFuse/improve-new-window-opening
Browse files Browse the repository at this point in the history
Respect CTRL/CMD+Click for opening instance editor in new tab
  • Loading branch information
cstns authored Nov 20, 2024
2 parents 8d89832 + 53dd1c2 commit bb77f60
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/src/pages/instance/components/EditorLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,15 @@ export default {
if (this.disabled) {
return false
}
window.open(this.url, !this.isImmersiveEditor ? '_blank' : '_self')
let href = this.url
let target = !this.isImmersiveEditor ? '_blank' : '_self'
// On Mac Keyboard, ⌘ + click opens in new tab (⌘ is `metaKey`)
// Otherwise Ctrl + click opens in new tab (Ctrl is `ctrlKey`)
if (evt.ctrlKey || evt.metaKey) {
target = '_blank'
href = this.editorURL
}
window.open(href, target)
return false
}
}
Expand Down

0 comments on commit bb77f60

Please sign in to comment.