Don't focus on checkbox when iframe doesn't have focus.

This commit is contained in:
ccd0 2015-02-28 21:27:21 -08:00
parent ddcc8b7c10
commit f3f110df22

View File

@ -29,7 +29,7 @@ Captcha.v2 =
$.globalEval 'window.focus = function() {};' $.globalEval 'window.focus = function() {};'
$.on window, 'focus', -> $.on window, 'focus', ->
$.queueTask -> $.queueTask ->
return unless checkbox = $.id 'recaptcha-anchor' return unless d.hasFocus() and (checkbox = $.id 'recaptcha-anchor')
checkbox.focus() unless d.activeElement is checkbox checkbox.focus() unless d.activeElement is checkbox
shouldFocus: false shouldFocus: false