summaryrefslogtreecommitdiff
path: root/rannak/mangud/partorg/plakat/script.js
diff options
context:
space:
mode:
authorRasmus <rasmus.luha@gmail.com>2023-06-10 16:45:12 +0300
committerRasmus <rasmus.luha@gmail.com>2023-06-10 16:45:12 +0300
commitac3bfb7728e9324e6a21035e7b321649550c60cb (patch)
treee467ad4fcf4b83f1d6aa6f9d8613ee7d0534bfc9 /rannak/mangud/partorg/plakat/script.js
parent562fd4eb2551cf26c19d619bdf00dbd965fb11d5 (diff)
finalFixes
Former-commit-id: 7fcc5cc7033804bb7e56b0ce5d3d77a6c2413236
Diffstat (limited to 'rannak/mangud/partorg/plakat/script.js')
-rw-r--r--rannak/mangud/partorg/plakat/script.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/rannak/mangud/partorg/plakat/script.js b/rannak/mangud/partorg/plakat/script.js
index 7b19edd..1435d10 100644
--- a/rannak/mangud/partorg/plakat/script.js
+++ b/rannak/mangud/partorg/plakat/script.js
@@ -15,38 +15,40 @@ let newTextBtns = document.querySelectorAll(".muuda");
newTextBtns.forEach(btn => {
btn.addEventListener("click" , e => {
+ console.log("clicked");
for (el of e.target.parentElement.parentElement.childNodes[1].childNodes) {
- console.log(el);
if (el.classList != undefined && el.classList.contains("addedText")){
el.classList.remove("addedText");
- console.log('dingdong');
}
}
let inputText = e.target.parentElement.childNodes[5].value;
+
let mySpan = document.createElement('span');
mySpan.classList.add('addedText');
mySpan.classList.add('oldAddedText');
mySpan.innerHTML = inputText;
+
let parentEl= e.target.parentElement.parentElement.childNodes[1];
parentEl.appendChild(mySpan);
mySpan.style.top = "50%";
mySpan.style.left = "35%";
- e.target.parentElement.childNodes[5].value = '';
+ e.target.parentElement.childNodes[5].value = '';
if (!addedTexts.includes(parentEl.classList[1]))
addedTexts.push(parentEl.classList[1]);
+
// Check If Done
if (addedTexts.length >= 4)
checkIfAllGood();