Use raw-loaders to import svgs and exportJS

This commit is contained in:
Jaiwanth 2021-07-27 11:37:47 +05:30
parent 9771f4d6c4
commit 57590b9a8a
7 changed files with 95 additions and 43 deletions

View file

@ -0,0 +1,25 @@
function showToastIfNeeded(replyId) {
const el = document.getElementById(replyId);
if (!el) {
showToast("The message you're looking for wasn't exported");
return;
}
}
function showToast(text) {
const el = document.getElementById("snackbar");
el.innerHTML = text;
el.className = "mx_show";
setTimeout(() => {
el.className = el.className.replace("mx_show", "");
}, 2000);
}
window.onload = () => {
document.querySelectorAll('.mx_reply_anchor').forEach(element => {
element.addEventListener('click', event => {
showToastIfNeeded(event.target.getAttribute("scroll-to"));
});
});
};