don't break when noscript blocks captcha

This commit is contained in:
James Campos 2011-06-14 20:02:03 -07:00
parent 48f83502cd
commit 24c9809529
2 changed files with 5 additions and 4 deletions

View File

@ -2242,8 +2242,9 @@
el = _ref2[_i];
el.tabIndex = 1;
}
recaptcha = $('#recaptcha_response_field');
return $.bind(recaptcha, 'keydown', Recaptcha.listener);
if (recaptcha = $('#recaptcha_response_field')) {
return $.bind(recaptcha, 'keydown', Recaptcha.listener);
}
},
listener: function(e) {
if (e.keyCode === 8 && this.value === '') {

View File

@ -1701,8 +1701,8 @@ Recaptcha =
#hack to tab from comment straight to recaptcha
for el in $$ '#recaptcha_table a'
el.tabIndex = 1
recaptcha = $ '#recaptcha_response_field'
$.bind recaptcha, 'keydown', Recaptcha.listener
if recaptcha = $ '#recaptcha_response_field' #NoScript
$.bind recaptcha, 'keydown', Recaptcha.listener
listener: (e) ->
if e.keyCode is 8 and @value is ''
Recaptcha.reload()