forked from FoundKeyGang/FoundKey
client: open links in new tab
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:
parent
1472c21cb6
commit
7914fcfef2
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue