Adds checkbox toggle js library

This commit is contained in:
kikito
2017-01-24 17:51:18 +01:00
parent 8dbc72c374
commit 86b895a7af
2 changed files with 14 additions and 0 deletions

View File

@@ -49,6 +49,7 @@
//= require fixed_bar
//= require banners
//= require social_share
//= require checkbox_toggle
//= require custom
var initialize_modules = function() {
@@ -74,6 +75,7 @@ var initialize_modules = function() {
App.FixedBar.initialize();
App.Banners.initialize();
App.SocialShare.initialize();
App.CheckboxToggle.initialize();
};
$(function(){

View File

@@ -0,0 +1,12 @@
App.CheckboxToggle =
initialize: ->
$('[data-checkbox-toggle]').on 'change', ->
$this = $(this)
$target = $($this.data('checkbox-toggle'))
if $this.is(':checked')
$target.show()
else
$target.hide()