Focus the captcha on captcha error. Fix #187.

This commit is contained in:
Nicolas Stepien 2012-02-06 11:27:08 +01:00
parent 31badbae9d
commit 7a2eee99f7
2 changed files with 4 additions and 0 deletions

View File

@ -1285,6 +1285,7 @@
el.textContent = err;
if (node) $.replace(el.firstChild, node);
qr.open();
if (/captcha|verification/i.test(err)) $('[autocomplete]', qr.el).focus();
if (d.hidden || d.oHidden || d.mozHidden || d.webkitHidden) {
return alert(err);
}

View File

@ -931,6 +931,9 @@ qr =
el.textContent = err
$.replace el.firstChild, node if node
qr.open()
if /captcha|verification/i.test err
# Focus the captcha input on captcha error.
$('[autocomplete]', qr.el).focus()
alert err if d.hidden or d.oHidden or d.mozHidden or d.webkitHidden
cleanError: ->
$('.warning', qr.el).textContent = null