Skip to content

Commit c366216

Browse files
committed
test currentTarget to open outside links
1 parent 67ecbfd commit c366216

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

assets/lib/tools.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ export async function open_outside(link) {
6060
} else if(link.prop !== undefined) { // jQuery object, expecting a link
6161
console.log("From jquery prop")
6262
await shell.openExternal(link.prop("href"))
63-
} else if(link.target !== undefined) { // onClick event with a target
63+
} else if(link.currentTarget && link.currentTarget.href) { // onClick event with a target
64+
console.log("From event.currentTarget")
65+
await shell.openExternal(link.currentTarget.href)
66+
} else if(link.target && link.target.href) { // onClick event with a target
6467
console.log("From event.target")
6568
await shell.openExternal(link.target.href)
6669
}

0 commit comments

Comments
 (0)