Fix captcha going below bottom of page due to delay in iframe loading.
This commit is contained in:
parent
34dfa8116c
commit
8734faf4c2
@ -135,15 +135,19 @@ Captcha.v2 =
|
||||
setupIFrame: (iframe) ->
|
||||
Captcha.replace.iframe iframe
|
||||
$.addClass QR.nodes.el, 'captcha-open'
|
||||
if QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight
|
||||
QR.nodes.el.style.top = null
|
||||
QR.nodes.el.style.bottom = '0px'
|
||||
@fixQRPosition()
|
||||
$.on iframe, 'load', @fixQRPosition
|
||||
iframe.focus() if d.activeElement is @nodes.counter
|
||||
# XXX Stop Recaptcha from changing focus from iframe -> body -> iframe on submit.
|
||||
$.global ->
|
||||
f = document.querySelector('#qr iframe')
|
||||
f.focus = f.blur = ->
|
||||
|
||||
fixQRPosition: ->
|
||||
if QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight
|
||||
QR.nodes.el.style.top = null
|
||||
QR.nodes.el.style.bottom = '0px'
|
||||
|
||||
setupTextArea: (textarea) ->
|
||||
$.one textarea, 'input', => @save true
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user