Skip to content

Commit

Permalink
test currentTarget to open outside links
Browse files Browse the repository at this point in the history
  • Loading branch information
Neradoc committed Oct 22, 2022
1 parent 67ecbfd commit c366216
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/lib/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export async function open_outside(link) {
} else if(link.prop !== undefined) { // jQuery object, expecting a link
console.log("From jquery prop")
await shell.openExternal(link.prop("href"))
} else if(link.target !== undefined) { // onClick event with a target
} else if(link.currentTarget && link.currentTarget.href) { // onClick event with a target
console.log("From event.currentTarget")
await shell.openExternal(link.currentTarget.href)
} else if(link.target && link.target.href) { // onClick event with a target
console.log("From event.target")
await shell.openExternal(link.target.href)
}
Expand Down

0 comments on commit c366216

Please sign in to comment.