From d747b3de129a0d684c8508bc8a06d8a255d2e983 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 21 Dec 2014 20:14:14 -0800 Subject: [PATCH] Include Recaptcha popup bubble in QR focus test. --- src/Posting/QR.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 0a1150f19..7c3288ff3 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -133,7 +133,10 @@ QR = focus: -> $.queueTask -> return unless QR.nodes - focus = d.activeElement and QR.nodes.el.contains d.activeElement + focus = d.activeElement and ( + QR.nodes.el.contains(d.activeElement) or + 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') QR.captcha[if focus then 'setup' else 'destroy']() $[if focus then 'addClass' else 'rmClass'] QR.nodes.el, 'focus'