Use raw-loaders to import svgs and exportJS
This commit is contained in:
parent
9771f4d6c4
commit
57590b9a8a
7 changed files with 95 additions and 43 deletions
25
src/utils/exportUtils/exportJS.js
Normal file
25
src/utils/exportUtils/exportJS.js
Normal 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"));
|
||||
});
|
||||
});
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue