From f00bb45c4ef7320eb283e4d4deb994e12658452d Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 29 Jun 2015 02:59:38 -0700 Subject: [PATCH] Take 2 at preventing momentary display of previous image when setting up captcha for a second time. --- src/Posting/Captcha.v1.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Posting/Captcha.v1.coffee b/src/Posting/Captcha.v1.coffee index 3cc0ba25c..57c7d0e4a 100644 --- a/src/Posting/Captcha.v1.coffee +++ b/src/Posting/Captcha.v1.coffee @@ -1,4 +1,6 @@ Captcha.v1 = + blank: "data:image/svg+xml," + init: -> return if d.cookie.indexOf('pass_enabled=1') >= 0 return unless @isEnabled = !!$ '#g-recaptcha, #captchaContainerAlt' @@ -73,7 +75,7 @@ Captcha.v1 = beforeSetup: -> {img, input} = @nodes img.parentNode.hidden = true - img.hidden = true + img.src = @blank input.value = '' input.placeholder = 'Focus to load reCAPTCHA' @count() @@ -169,7 +171,7 @@ Captcha.v1 = load: -> if $('#captchaContainerAlt[class~="recaptcha_is_showing_audio"]') - @nodes.img.hidden = true + @nodes.img.src = @blank return return unless @nodes.challenge.firstChild return unless challenge_image = $.id 'recaptcha_challenge_image' @@ -178,7 +180,6 @@ Captcha.v1 = challenge = @nodes.challenge.firstChild.value @nodes.img.alt = challenge @nodes.img.src = challenge_image.src - @nodes.img.hidden = false @nodes.input.value = '' @clear()