Files
grecia/app/assets/javascripts/checkbox_toggle.js.coffee
Javi Martín b27855c1cf Use double quotes in CoffeeScript files
As we do in the rest of the application.

Note we cannot add a rule enforcing double quotes because CoffeeScript
Lint does not have such rule.
2019-03-06 11:41:21 +01:00

11 lines
245 B
CoffeeScript

App.CheckboxToggle =
initialize: ->
$("[data-checkbox-toggle]").on "change", ->
$this = $(this)
$target = $($this.data("checkbox-toggle"))
if $this.is(":checked")
$target.show()
else
$target.hide()