Revert "Better detection of when the captcha is open."

This reverts commit 7f32648ed0e837c0adb44e08527837e606526470.
This commit is contained in:
ccd0 2014-12-08 18:22:38 -08:00
parent fcc1a60d51
commit 6fb037eb9e

View File

@ -30,19 +30,15 @@ QR.captcha =
shouldFocus: false
timeouts: {}
occupied: ->
{container} = @nodes
(container.firstChild or container.dataset.widgetID) and !@timeouts.destroy
needed: ->
captchaCount = @captchas.length
captchaCount++ if @occupied()
captchaCount++ if @nodes.container.dataset.widgetID and !@timeouts.destroy
postsCount = QR.posts.length
postsCount = 0 if postsCount is 1 and !Conf['Auto-load captcha'] and !QR.posts[0].com and !QR.posts[0].file
captchaCount < postsCount
toggle: ->
if @occupied()
if @nodes.container.dataset.widgetID and !@timeouts.destroy
@destroy()
else
@shouldFocus = true
@ -55,7 +51,7 @@ QR.captcha =
clearTimeout @timeouts.destroy
delete @timeouts.destroy
return @reload()
return if @occupied()
return if @nodes.container.dataset.widgetID
$.globalEval '''
(function() {
var container = document.querySelector("#qr .captcha-container");