Prevent Recaptcha from keeping focus when popup dismissed.

Best solution for now since we still have to support the outgoing
version.  When the outgoing version is gone, we may be able to
remove the strict anti-scroll measures, and this will no longer
be necessary.
This commit is contained in:
ccd0 2015-10-30 14:43:58 -07:00
parent 15b3bf5884
commit ca6b6994a7

View File

@ -237,6 +237,9 @@ Captcha.v2 =
if $ 'iframe[src^="https://www.google.com/recaptcha/api2/frame"]', node
new MutationObserver(@fixBubble.bind(@, node)).observe node,
attributes: true
# Prevent Recaptcha from keeping focus when popup dismissed.
if overlay = $ 'div[style*="position: fixed;"]', node
$.on overlay, 'click', -> $('#qr iframe')?.blur()
fixBubble: (node) ->
{bottom, right, width} = node.getBoundingClientRect()