mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-24 12:14:05 +03:00
chore(entry) move <a> handling code from q-app (#21)
This commit is contained in:
parent
8adb667229
commit
88f01efbe5
12
lib/tauri.js
12
lib/tauri.js
@ -11,6 +11,18 @@
|
||||
*
|
||||
**/
|
||||
|
||||
// open <a href="..."> links with the Tauri API
|
||||
document.querySelector('body').addEventListener('click', e => {
|
||||
let target = e.target
|
||||
while (target != null) {
|
||||
if (target.matches ? target.matches('a') : target.msMatchesSelector('a')) {
|
||||
tauri.open(target.href)
|
||||
break
|
||||
}
|
||||
target = target.parentElement
|
||||
}
|
||||
}, true)
|
||||
|
||||
/**
|
||||
* @module tauri
|
||||
* @description This API interface makes powerful interactions available
|
||||
|
Loading…
Reference in New Issue
Block a user