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.
11 lines
245 B
CoffeeScript
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()
|