Skip to content

Commit

Permalink
Drag and Drop with foreign characters didn't work
Browse files Browse the repository at this point in the history
- Also enlarged drop area, so it works better on touch devices
  • Loading branch information
torinfo committed Mar 16, 2015
1 parent 71d496f commit f8629d7
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -246,8 +246,8 @@
});

$targetHolder.find(".target")
.width(maxW) // make targets fit longest word before clearing text from them
.height($targetHolder.find(".target").height())
.width(maxW + 30) // make targets fit longest word before clearing text from them
.height($targetHolder.find(".target").height() + 10)
.html("")
.droppable({
drop: function(event, ui) {
Expand Down Expand Up @@ -365,11 +365,11 @@
}
})
.disableSelection();

for (i=0; i<$("#targetHolder .target").length; i++) {
$("#targetHolder .target:eq(" + i + ")").droppable({
// only label with correct text can be dropped on target
accept: $("#labelHolder .label").filter(function() {return $(this).html() == answerData[i]; })
accept: $("#labelHolder .label").filter(function() { return $(this).html() == $('<textarea>').html(answerData[i]).text(); })
});
}

Expand Down

0 comments on commit f8629d7

Please sign in to comment.