Perform our anti-scroll hack a little earlier to deal with Google's latest nonsense.

This commit is contained in:
ccd0 2015-02-20 21:53:50 -08:00
parent 8c210a52f8
commit e577c018d5

View File

@ -137,13 +137,13 @@ QR =
unless $$('.goog-bubble-content > iframe').some((el) -> el.getBoundingClientRect().top >= 0)
focus = d.activeElement and QR.nodes.el.contains(d.activeElement)
$[if focus then 'addClass' else 'rmClass'] QR.nodes.el, 'focus'
if chrome?
# 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'
QR.scrollY = window.scrollY
$.on d, 'scroll', QR.scrollLock
else
$.off d, 'scroll', QR.scrollLock
if chrome?
# XXX Stop anomalous scrolling on space/tab in/into captcha iframe.
if d.activeElement and QR.nodes.el.contains(d.activeElement) and d.activeElement.nodeName is 'IFRAME'
QR.scrollY = window.scrollY
$.on d, 'scroll', QR.scrollLock
else
$.off d, 'scroll', QR.scrollLock
scrollLock: ->
if d.activeElement and QR.nodes.el.contains(d.activeElement) and d.activeElement.nodeName is 'IFRAME'