Need more captchas or captcha error -> focus on captcha iframe

This commit is contained in:
ccd0 2014-12-08 21:35:46 -08:00
parent 0e916592d8
commit 145dc078a5
2 changed files with 6 additions and 6 deletions

View File

@ -49,12 +49,12 @@ QR.captcha =
if @occupied()
@destroy()
else
@shouldFocus = true
@setup true
@setup true, true
setup: (force) ->
setup: (focus, force) ->
return unless @isEnabled and (@needed() or force)
$.addClass QR.nodes.el, 'captcha-open'
@shouldFocus = true if focus
if @timeouts.destroy
clearTimeout @timeouts.destroy
delete @timeouts.destroy
@ -129,7 +129,7 @@ QR.captcha =
@captchas = @captchas[i..]
@count()
$.set 'captchas', @captchas
@setup()
@setup true
count: ->
@nodes.counter.textContent = "Captchas: #{@captchas.length}"

View File

@ -145,7 +145,7 @@ QR =
el = err
el.removeAttribute 'style'
if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent
QR.captcha.setup()
QR.captcha.setup true
QR.notify el
alert el.textContent if d.hidden
@ -791,7 +791,7 @@ QR =
QR.close()
else
post.rm()
QR.captcha.setup()
QR.captcha.setup true
QR.cooldown.add req.uploadEndTime, threadID, postID