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

16 lines
479 B
JavaScript
Raw Normal View History

document.getElementById("root").addEventListener("click", (e) => {
// console.log("Got click", e.target)
const dataSet = e.target.dataset;
if (dataSet["onclick"]) {
syscall("event.dispatch", "preview:click", dataSet["onclick"]).catch((e) =>
console.log("Error", e)
);
} else if (dataSet["pos"]) {
syscall(
"event.dispatch",
"preview:click",
2023-01-22 17:53:14 +00:00
JSON.stringify(["pos", dataSet["pos"]]),
).catch((e) => console.log("Error", e));
}
});