diff --git a/src/Posting/Captcha.v1.coffee b/src/Posting/Captcha.v1.coffee index 9a438d0a0..aa50aa354 100644 --- a/src/Posting/Captcha.v1.coffee +++ b/src/Posting/Captcha.v1.coffee @@ -95,7 +95,7 @@ Captcha.v1 = setup: (focus, force) -> return unless @isEnabled and (force or @needed()) @create() - @nodes.input.focus() if focus and d.activeElement in [QR.nodes.status, d.body] + @nodes.input.focus() if focus afterSetup: -> return unless challenge = $.id 'recaptcha_challenge_field_holder' diff --git a/src/Posting/Captcha.v2.coffee b/src/Posting/Captcha.v2.coffee index 72c74f068..99bbe2cf2 100644 --- a/src/Posting/Captcha.v2.coffee +++ b/src/Posting/Captcha.v2.coffee @@ -73,7 +73,7 @@ Captcha.v2 = setup: (focus, force) -> return unless @isEnabled and (@needed() or force) - @nodes.counter.focus() if focus and d.activeElement in [QR.nodes.status, d.body] + @nodes.counter.focus() if focus if @timeouts.destroy clearTimeout @timeouts.destroy delete @timeouts.destroy @@ -214,7 +214,7 @@ Captcha.v2 = @captchas = @captchas[i..] @count() $.set 'captchas', @captchas - @setup true + @setup(d.activeElement is QR.nodes.status) count: -> @nodes.counter.textContent = "Captchas: #{@captchas.length}" diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index cd22cbafd..536a6aad7 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -633,7 +633,7 @@ QR = captcha = QR.captcha.getOne() unless captcha err = 'No valid captcha.' - QR.captcha.setup true + QR.captcha.setup(!QR.cooldown.auto or d.activeElement is QR.nodes.status) QR.cleanNotifications() if err @@ -769,7 +769,7 @@ QR = QR.cooldown.addDelay post, seconds else # stop auto-posting QR.cooldown.auto = false - QR.captcha.setup QR.cooldown.auto + QR.captcha.setup(QR.cooldown.auto and d.activeElement is QR.nodes.status) QR.cooldown.auto = false if QR.captcha.isEnabled and !QR.captcha.captchas.length QR.status() QR.error err