fix some stuff

This commit is contained in:
Bruno Rybársky 2023-04-01 21:02:51 +02:00
parent c256a7f68e
commit f185a2793c
No known key found for this signature in database
GPG Key ID: DFE2C061EF985CD4

@ -192,7 +192,7 @@ function showImages() {
$(".originalplace").on("click", function(e){ $(".originalplace").on("click", function(e){
let targetElement = $(this); let targetElement = $(this);
if (targetElement.hasClass("imageholderak")){ if (targetElement.hasClass("imageholderak")){
let [emptyindex, idcko] = getEmptyIndex($(".finalimageplace"), this); let [emptyindex, idcko] = getEmptyIndex($(".finalimageplace"));
if (emptyindex > -1){ if (emptyindex > -1){
let changingelement = $("#" + idcko); let changingelement = $("#" + idcko);
changingelement.html(targetElement.html()); changingelement.html(targetElement.html());
@ -202,7 +202,7 @@ function showImages() {
} }
if (targetElement.hasClass("letterholderak")){ if (targetElement.hasClass("letterholderak")){
let [emptyindex, idcko] = getEmptyIndex($(".finalletterplace"), this); let [emptyindex, idcko] = getEmptyIndex($(".finalletterplace"));
if (emptyindex > -1){ if (emptyindex > -1){
let changingelement = $("#" + idcko); let changingelement = $("#" + idcko);
umami.trackEvent('Clicked letter', { type: 'clickletter', datacode: targetElement.attr("datacode") }); umami.trackEvent('Clicked letter', { type: 'clickletter', datacode: targetElement.attr("datacode") });
@ -263,6 +263,7 @@ function generateItem(word){
$(".itemholderak").each(function(){ $(".itemholderak").each(function(){
$(this).on("click", function (e){ $(this).on("click", function (e){
let datacode = $(this).attr("datacode"); let datacode = $(this).attr("datacode");
umami.trackEvent('Listened to image', { type: 'listenimage', datacode: $(this).attr("datacode") });
document.getElementById("audplayitem"+ datacode).play(); document.getElementById("audplayitem"+ datacode).play();
}) })
}); });
@ -290,7 +291,6 @@ $(function() {
$("#verify").on("click", checkAnswers); $("#verify").on("click", checkAnswers);
$("#trashcan").on("click", cleanup); $("#trashcan").on("click", cleanup);
umami.trackEvent('Page loaded', { type: 'load' });
}); });