This should be checked before trying to focus.

This commit is contained in:
ccd0 2015-04-17 21:17:01 -07:00
parent 09acfaf9a2
commit 4c64cf3b9b

View File

@ -31,6 +31,7 @@ Captcha.fixes =
focusImage: (img) ->
# XXX Image is not focusable at first in Firefox; to be refactored when I figure out why.
$.asap ->
return true unless doc.contains img
img.focus()
d.activeElement is img or not doc.contains img
d.activeElement is img
, ->