fix cleanup bug

This commit is contained in:
Bruno Rybársky 2023-04-01 11:07:33 +02:00
parent fd9e2acc83
commit de7dc499ee
No known key found for this signature in database
GPG Key ID: DFE2C061EF985CD4

@ -14,10 +14,12 @@ let words = [
];
function makeSpaceWord(word){
$("#lettersky").html("");
$("#imagesky").html("");
let length = word.length;
for (var i = 0; i < length; i++) {
$("#lettersky").append('<td><div ondrop="drop(event)" ondragover="allowDrop(event)" class="letterplace finalletterplace place"></td>');
$("#imagesky").append('<td><div ondrop="drop(event)" ondragover="allowDrop(event)" class="imageplace finalimageplace place"></td>');
$("#lettersky").append('<td><div ondrop="drop(event)" ondragover="allowDrop(event)" class="letterplace finalplace finalletterplace place"></td>');
$("#imagesky").append('<td><div ondrop="drop(event)" ondragover="allowDrop(event)" class="imageplace finalplace finalimageplace place"></td>');
}
$("#lettersky").append('<td><div id="letterstatus" class="status"></div></td>');
$("#imagesky").append('<td><div id="imagestatus" class="status"></div></td>');
@ -26,16 +28,18 @@ function makeSpaceWord(word){
let prefix = "assets/";
function cleanup(){
var htmls = [];
var returntos = [];
$("[returnto]").each(function (index){
htmls.push($(this).prop("outerHTML"));
returntos.push($(this).attr("returnto"));
$(this).remove();
});
for (var x = 0 ; x < returntos.length; x++) {
//$('[returntarget="' + returntos[x] + '"]').html(htmls[x]);
}
// var htmls = [];
// var returntos = [];
// $("[returnto]").each(function (index){
// htmls.push($(this).prop("outerHTML"));
// returntos.push($(this).attr("returnto"));
// $(this).remove();
// });
// for (var x = 0 ; x < returntos.length; x++) {
// //$('[returntarget="' + returntos[x] + '"]').html(htmls[x]);
// }
$(".finalplace").html("");
}
function checkAnswers() {