More consistent checkbox focusing.

This commit is contained in:
ccd0 2015-04-16 22:20:24 -07:00
parent a7bbdfcdf7
commit 4e49ed7c1c

View File

@ -26,10 +26,13 @@ Captcha.v2 =
$.queueTask => @save false
initFrame: ->
$.on window, 'focus', ->
$.queueTask ->
return unless d.hasFocus() and (checkbox = $.id 'recaptcha-anchor')
checkbox.focus() unless d.activeElement is checkbox
$.onExists d.body, '#recaptcha-anchor', true, (checkbox) ->
focus = ->
if d.hasFocus() and d.activeElement isnt checkbox
checkbox.focus()
focus()
$.on window, 'focus', ->
$.queueTask focus
shouldFocus: false
timeouts: {}