From 30d39e5fdd74aea4eeb154943f57094346b7aeca Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 14 Nov 2015 13:15:19 -0800 Subject: [PATCH] Restore backspace to refresh captcha in report window. #527 --- src/Miscellaneous/Report.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Miscellaneous/Report.coffee b/src/Miscellaneous/Report.coffee index 59151f030..fe49989ea 100755 --- a/src/Miscellaneous/Report.coffee +++ b/src/Miscellaneous/Report.coffee @@ -37,6 +37,12 @@ Report = else Report.fit 'body' + if !Conf['Use Recaptcha v2 in Reports'] and $.hasClass(doc, 'js-enabled') and d.cookie.indexOf('pass_enabled=1') < 0 + $.onExists d.body, '#recaptcha_response_field', true, (field) -> + $.on field, 'keydown', (e) -> + if e.keyCode is 8 and not field.value + $.global -> window.Recaptcha.reload() + fit: (selector) -> return unless (el = $ selector, doc) and getComputedStyle(el).visibility isnt 'hidden' dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8