Move form checking to named function.
This commit is contained in:
parent
cde281cdf6
commit
07fa6e944e
@ -55,10 +55,7 @@ Captcha.fixes =
|
|||||||
$.addStyle @cssNoscript
|
$.addStyle @cssNoscript
|
||||||
@addLabels()
|
@addLabels()
|
||||||
$.on d, 'keydown', @keybinds.bind(@)
|
$.on d, 'keydown', @keybinds.bind(@)
|
||||||
$.on $('.fbc-imageselect-challenge > form'), 'submit', (e) =>
|
$.on $('.fbc-imageselect-challenge > form'), 'submit', @checkForm.bind(@)
|
||||||
n = 0
|
|
||||||
n++ for checkbox in @images when checkbox.checked
|
|
||||||
e.preventDefault() if n is 0
|
|
||||||
|
|
||||||
fixImages: ->
|
fixImages: ->
|
||||||
@images = $$ '.rc-imageselect-target > div'
|
@images = $$ '.rc-imageselect-target > div'
|
||||||
@ -77,6 +74,11 @@ Captcha.fixes =
|
|||||||
label
|
label
|
||||||
$.add imageSelect, labels
|
$.add imageSelect, labels
|
||||||
|
|
||||||
|
checkForm: (e) ->
|
||||||
|
n = 0
|
||||||
|
n++ for checkbox in @images when checkbox.checked
|
||||||
|
e.preventDefault() if n is 0
|
||||||
|
|
||||||
keybinds: (e) ->
|
keybinds: (e) ->
|
||||||
return unless @images and doc.contains(@images[0]) and d.activeElement
|
return unless @images and doc.contains(@images[0]) and d.activeElement
|
||||||
reload = $ '#recaptcha-reload-button, .fbc-button-reload'
|
reload = $ '#recaptcha-reload-button, .fbc-button-reload'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user