Don't steal focus from privacy/terms links, but take them out of the tab order.

They should now be keyboard-reachable by searching for the text,
but won't get in the way when tabbing to the submit button on
various forms.
This commit is contained in:
ccd0 2016-02-13 23:47:49 -08:00
parent 6ab842c472
commit 7c603e5e27

View File

@ -51,12 +51,17 @@ Captcha.fixes =
initMain: ->
$.onExists d.body, '#recaptcha-anchor', (checkbox) ->
focus = ->
if d.hasFocus() and d.activeElement isnt checkbox
if d.hasFocus() and d.activeElement in [d.documentElement, d.body]
checkbox.focus()
focus()
$.on window, 'focus', ->
$.queueTask focus
# Remove Privacy and Terms links from tab order.
for a in $$ '.rc-anchor-pt a'
a.tabIndex = -1
return
initPopup: ->
$.addStyle @css
@fixImages()