New version of captcha when hiding bubble sets visibility to hidden and doesn't always go offscreen.

This commit is contained in:
ccd0 2015-10-30 12:04:14 -07:00
parent fbbfad75f8
commit 7ddefaf35a
2 changed files with 3 additions and 1 deletions

View File

@ -241,6 +241,7 @@ Captcha.v2 =
fixBubble: (node) ->
{bottom, right, width} = node.getBoundingClientRect()
if (
getComputedStyle(node).visibility isnt 'hidden' and
bottom > 0 and # not deliberately offscreen
right > doc.clientWidth # offscreen to right
)

View File

@ -154,7 +154,8 @@ QR =
inBubble: ->
bubbles = $$ 'iframe[src^="https://www.google.com/recaptcha/api2/frame"]'
d.activeElement in bubbles or bubbles.some((el) -> el.getBoundingClientRect().bottom > 0)
d.activeElement in bubbles or bubbles.some (el) ->
getComputedStyle(el).visibility isnt 'hidden' and el.getBoundingClientRect().bottom > 0
inCaptcha: ->
(d.activeElement?.nodeName is 'IFRAME' and QR.nodes.el.contains(d.activeElement)) or (QR.hasFocus and QR.inBubble())