wait for captcha image to exist before trying to check the URL

This commit is contained in:
ccd0 2014-04-29 00:16:31 -07:00
parent a24086828c
commit 3bd7003820

View File

@ -110,11 +110,12 @@ QR.captcha =
load: ->
return unless @nodes.challenge.firstChild
return unless challenge_image = $.id 'recaptcha_challenge_image'
# -1 minute to give upload some time.
@timeout = Date.now() + @lifetime * $.SECOND - $.MINUTE
challenge = @nodes.challenge.firstChild.value
@nodes.img.alt = challenge
@nodes.img.src = $.id('recaptcha_challenge_image').src
@nodes.img.src = challenge_image.src
@nodes.input.value = null
@clear()