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