1
0
silverbullet/plugs/index/asset/linked_mentions.js

20 lines
617 B
JavaScript
Raw Normal View History

function processClick(e) {
const dataEl = e.target.closest("[data-ref]");
syscall(
"system.invokeFunction",
"index.navigateToMention",
dataEl.getAttribute("data-ref"),
).catch(console.error);
}
document.getElementById("link-ul").addEventListener("click", processClick);
document.getElementById("hide-button").addEventListener("click", () => {
syscall("system.invokeFunction", "index.toggleMentions").catch(console.error);
});
document.getElementById("reload-button").addEventListener("click", () => {
syscall("system.invokeFunction", "index.renderMentions").catch(
console.error,
);
});