Sha256: 1facbc8f38c95a2cc9ec025d8570dc165d60132eb3322f940b86a5793db62d14
Contents?: true
Size: 1.67 KB
Versions: 32
Compression:
Stored size: 1.67 KB
Contents
{I" class:ETI"BundledAsset; FI"logical_path; TI"spina/switch.js; FI" pathname; TI"R/Users/bram/apps/Spina-template/app/assets/javascripts/spina/switch.js.coffee; FI"content_type; TI"application/javascript; TI" mtime; Tl+>÷TI"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('<a href="#' + input.attr("id") + '" class="' + klass + '"> <span class="knob"></span> </a>'); } }); }; $(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"required_assets_digest; TI"%feb4e3aa1c7411463a27a6a18201a859; FI" _version; TI"%64e62ddc273c2f5847f30d698ca14b67; F
Version data entries
32 entries across 16 versions & 1 rubygems