Answer input textbox colour is reset after wrong entry on next keypress.

This commit is contained in:
neviyn 2016-01-26 01:09:43 +00:00
parent 92347da966
commit 2502c099a3
2 changed files with 7 additions and 0 deletions

View File

@ -100,6 +100,9 @@ toggleQuizMode = () ->
$(document).keypress (e) ->
if(e.which == 13)
$("#submit-answer").click();
else
if($("#kana").hasClass("wrong"))
$("#kana").removeClass("wrong")
$("#submit-answer").click (e) ->
e.preventDefault();

View File

@ -147,6 +147,10 @@
$(document).keypress(function(e) {
if (e.which === 13) {
return $("#submit-answer").click();
} else {
if ($("#kana").hasClass("wrong")) {
return $("#kana").removeClass("wrong");
}
}
});