fix, refactor conditional
This commit is contained in:
parent
ed353971e4
commit
d2fb9a275a
@ -1263,7 +1263,12 @@
|
||||
return $('#recaptcha_challenge_field', qr.el).value = target.value;
|
||||
},
|
||||
captchaKeydown: function(e) {
|
||||
if (e.keyCode !== 13 || (!cooldown.duration || ($('textarea', qr.el).value || $('#qr_form input[type=file]', qr.el).length))) {
|
||||
var blank;
|
||||
if (e.keyCode !== 13) {
|
||||
return;
|
||||
}
|
||||
blank = !$('textarea', qr.el).value && !$('input[type=file]', qr.el).files.length;
|
||||
if (!(blank || cooldown.duration)) {
|
||||
return;
|
||||
}
|
||||
$('#auto', qr.el).checked = true;
|
||||
|
||||
@ -997,8 +997,11 @@ qr =
|
||||
$('#recaptcha_challenge_field', qr.el).value = target.value
|
||||
|
||||
captchaKeydown: (e) ->
|
||||
return if e.keyCode isnt 13 or (!cooldown.duration or
|
||||
($('textarea', qr.el).value or $('#qr_form input[type=file]', qr.el).length))
|
||||
return unless e.keyCode is 13 #enter
|
||||
|
||||
blank = !$('textarea', qr.el).value and !$('input[type=file]', qr.el).files.length
|
||||
return unless blank or cooldown.duration
|
||||
|
||||
$('#auto', qr.el).checked = true
|
||||
$('#autohide', qr.el).checked = true if conf['Auto Hide QR']
|
||||
qr.captchaPush.call this
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user