{I" class:ETI"ProcessedAsset;FI"logical_path;TI"spina/switch.js;FI" pathname;TI"}/Users/bram/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spina-template-0.2.4/app/assets/javascripts/spina/switch.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+Ü¥UI" length;TiáI" digest;TI"%aa162b456a3e0ea812ce9c2838666081;FI" source;TI"á(function() { var toggleSwitch; $.fn.spinaSwitch = function() { return this.each(function() { var input, klass; if (!$(this).attr('data-plugin-switch')) { input = $(this); input.attr('data-plugin-switch', true); input.hide(); if (input.is(':checked')) { klass = "switch active"; } else { klass = "switch"; } return input.after(' '); } }); }; $(document).on('click', 'a.switch', function(e) { return toggleSwitch(e); }); $(document).on('touchend', 'a.switch', function(e) { return toggleSwitch(e); }); toggleSwitch = function(e) { var checkbox, input; checkbox = $(e.currentTarget); input = $(checkbox.attr("href")); if (checkbox.hasClass('activated') || checkbox.hasClass('active')) { checkbox.removeClass('active'); checkbox.removeClass('activated'); checkbox.addClass('deactivated'); input.prop("checked", false); } else { checkbox.addClass('activated'); checkbox.removeClass('deactivated'); input.prop("checked", true); } return false; }; }).call(this); ;TI"dependency_digest;TI"%feb4e3aa1c7411463a27a6a18201a859;FI"required_paths;T[I"}/Users/bram/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spina-template-0.2.4/app/assets/javascripts/spina/switch.js.coffee;FI"dependency_paths;T[{I" path;TI"}/Users/bram/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spina-template-0.2.4/app/assets/javascripts/spina/switch.js.coffee;F@I"2015-03-11T21:30:20+01:00;T@I"%74eb4a486863c1ed0a69956252c02490;FI" _version;TI"%64e62ddc273c2f5847f30d698ca14b67;F