1
0
Fork 0
mirror of https://github.com/Findus23/lw1.at.git synced 2024-09-10 05:13:46 +02:00
lw1.at/assets/feedback.ts

17 lines
595 B
TypeScript

import {matomo} from "./matomo";
export function initFeedback() {
const feedbackButton = document.getElementById("readmore")
const feedbackDiv = document.getElementById("sentReadmore")!
if (feedbackButton) {
feedbackButton.addEventListener("click", () => {
const id = feedbackButton.dataset["id"]
if (matomo) {
matomo.trackEvent('Feedback', 'readmore', id);
} else {
console.info("Feedback not sent as Matomo isn't loaded");
}
feedbackDiv.style.display = "block"
})
}
}