1
0
silverbullet/plugs/markdown/assets/handler.js

9 lines
331 B
JavaScript

document.getElementById("root").addEventListener("click", (e) => {
// console.log("Got click", e.target)
const dataSet = e.target.dataset;
if(dataSet["onclick"]) {
sendEvent("preview:click", dataSet["onclick"]);
} else if(dataSet["pos"]) {
sendEvent("preview:click", JSON.stringify(["pos", dataSet["pos"]]));
}
})