Don't add QR.focus listener until is QR created.
This commit is contained in:
parent
87b3431f5e
commit
ef7715ecbf
@ -15,11 +15,6 @@ QR =
|
|||||||
|
|
||||||
$.on d, '4chanXInitFinished', @initReady
|
$.on d, '4chanXInitFinished', @initReady
|
||||||
|
|
||||||
window.addEventListener 'focus', @focus, true
|
|
||||||
window.addEventListener 'blur', @focus, true
|
|
||||||
# We don't receive blur events from captcha iframe.
|
|
||||||
$.on d, 'click', @focus
|
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Quick Reply'
|
name: 'Quick Reply'
|
||||||
cb: @node
|
cb: @node
|
||||||
@ -133,7 +128,6 @@ QR =
|
|||||||
|
|
||||||
focus: ->
|
focus: ->
|
||||||
$.queueTask ->
|
$.queueTask ->
|
||||||
return unless QR.nodes
|
|
||||||
unless $$('.goog-bubble-content > iframe').some((el) -> el.getBoundingClientRect().top >= 0)
|
unless $$('.goog-bubble-content > iframe').some((el) -> el.getBoundingClientRect().top >= 0)
|
||||||
focus = d.activeElement and QR.nodes.el.contains(d.activeElement)
|
focus = d.activeElement and QR.nodes.el.contains(d.activeElement)
|
||||||
$[if focus then 'addClass' else 'rmClass'] QR.nodes.el, 'focus'
|
$[if focus then 'addClass' else 'rmClass'] QR.nodes.el, 'focus'
|
||||||
@ -571,6 +565,11 @@ QR =
|
|||||||
$.on nodes.fileInput, 'change', QR.handleFiles
|
$.on nodes.fileInput, 'change', QR.handleFiles
|
||||||
$.on nodes.customCooldown, 'click', QR.toggleCustomCooldown
|
$.on nodes.customCooldown, 'click', QR.toggleCustomCooldown
|
||||||
|
|
||||||
|
window.addEventListener 'focus', QR.focus, true
|
||||||
|
window.addEventListener 'blur', QR.focus, true
|
||||||
|
# We don't receive blur events from captcha iframe.
|
||||||
|
$.on d, 'click', QR.focus
|
||||||
|
|
||||||
# save selected post's data
|
# save selected post's data
|
||||||
items = ['thread', 'name', 'email', 'sub', 'com', 'filename']
|
items = ['thread', 'name', 'email', 'sub', 'com', 'filename']
|
||||||
i = 0
|
i = 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user