Restore backspace to refresh captcha in report window. #527

This commit is contained in:
ccd0 2015-11-14 13:15:19 -08:00
parent 1d11276d64
commit 30d39e5fdd

View File

@ -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