Convert CofeeScript to JavaScript
Compiled using `coffee -c` with CoffeeScript 1.12.6.
This commit is contained in:
18
app/assets/javascripts/checkbox_toggle.js
Normal file
18
app/assets/javascripts/checkbox_toggle.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// Generated by CoffeeScript 1.12.6
|
||||
(function() {
|
||||
"use strict";
|
||||
App.CheckboxToggle = {
|
||||
initialize: function() {
|
||||
return $("[data-checkbox-toggle]").on("change", function() {
|
||||
var $target;
|
||||
$target = $($(this).data("checkbox-toggle"));
|
||||
if ($(this).is(":checked")) {
|
||||
return $target.show();
|
||||
} else {
|
||||
return $target.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
Reference in New Issue
Block a user