Revert "Destroy captcha when QR is hidden."
This reverts commit f2260ca2ac3dc7060a33eee77f7ccace21e8f6fe. Conflicts: src/Posting/QR.coffee
This commit is contained in:
parent
6c639fe20f
commit
add0f3d3a2
@ -47,6 +47,7 @@ Keybinds =
|
|||||||
$('.close', notification).click()
|
$('.close', notification).click()
|
||||||
else if QR.nodes and !QR.nodes.el.hidden
|
else if QR.nodes and !QR.nodes.el.hidden
|
||||||
if Conf['Persistent QR']
|
if Conf['Persistent QR']
|
||||||
|
QR.captcha.destroy()
|
||||||
QR.hide()
|
QR.hide()
|
||||||
else
|
else
|
||||||
QR.close()
|
QR.close()
|
||||||
|
|||||||
@ -37,7 +37,7 @@ Captcha.v2 =
|
|||||||
captchaCount < @postsCount
|
captchaCount < @postsCount
|
||||||
|
|
||||||
onNewPost: ->
|
onNewPost: ->
|
||||||
@setup() unless $.hasClass(QR.nodes.el, 'autohide') and !$.hasClass(QR.nodes.el, 'focus')
|
@setup()
|
||||||
|
|
||||||
onPostChange: ->
|
onPostChange: ->
|
||||||
@setup() if @postsCount is 0
|
@setup() if @postsCount is 0
|
||||||
|
|||||||
@ -137,9 +137,11 @@ QR =
|
|||||||
QR.nodes.el.contains(d.activeElement) or
|
QR.nodes.el.contains(d.activeElement) or
|
||||||
d.activeElement.nodeName is 'IFRAME' and /^https:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src)
|
d.activeElement.nodeName is 'IFRAME' and /^https:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src)
|
||||||
)
|
)
|
||||||
if $.hasClass(QR.nodes.el, 'autohide') and focus isnt $.hasClass(QR.nodes.el, 'focus')
|
if focus
|
||||||
QR.captcha[if focus then 'setup' else 'destroy']()
|
QR.captcha.setup() if $.hasClass(QR.nodes.el, 'autohide') and !$.hasClass(QR.nodes.el, 'focus')
|
||||||
$[if focus then 'addClass' else 'rmClass'] QR.nodes.el, 'focus'
|
$.addClass QR.nodes.el, 'focus'
|
||||||
|
else
|
||||||
|
$.rmClass QR.nodes.el, 'focus'
|
||||||
if chrome?
|
if chrome?
|
||||||
# XXX Stop anomalous scrolling on space/tab in captcha iframe.
|
# XXX Stop anomalous scrolling on space/tab in captcha iframe.
|
||||||
if d.activeElement and QR.nodes.el.contains(d.activeElement) and d.activeElement.nodeName is 'IFRAME'
|
if d.activeElement and QR.nodes.el.contains(d.activeElement) and d.activeElement.nodeName is 'IFRAME'
|
||||||
@ -154,7 +156,6 @@ QR =
|
|||||||
else
|
else
|
||||||
$.off d, 'scroll', QR.scrollLock
|
$.off d, 'scroll', QR.scrollLock
|
||||||
hide: ->
|
hide: ->
|
||||||
QR.captcha.destroy()
|
|
||||||
d.activeElement.blur()
|
d.activeElement.blur()
|
||||||
$.addClass QR.nodes.el, 'autohide'
|
$.addClass QR.nodes.el, 'autohide'
|
||||||
QR.nodes.autohide.checked = true
|
QR.nodes.autohide.checked = true
|
||||||
@ -576,7 +577,7 @@ QR =
|
|||||||
QR.cooldown.init()
|
QR.cooldown.init()
|
||||||
QR.captcha.init()
|
QR.captcha.init()
|
||||||
$.add d.body, dialog
|
$.add d.body, dialog
|
||||||
QR.captcha.setup() unless Conf['Persistent QR'] and Conf['Auto Hide QR']
|
QR.captcha.setup()
|
||||||
|
|
||||||
# Create a custom event when the QR dialog is first initialized.
|
# Create a custom event when the QR dialog is first initialized.
|
||||||
# Use it to extend the QR's functionalities, or for XTRM RICE.
|
# Use it to extend the QR's functionalities, or for XTRM RICE.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user