{:uriI"file:///Users/eduardodeoliveirazaghi/Projects/loldesign/loldesign_publisher/app/assets/javascripts/loldesign_publisher/activable.js?type=application/javascript&pipeline=self&id=3f0dd6c9a4e383bec0b87d391b00f56e34d465cf90a50735cb5eb5d2df31b506:ET:load_pathI"`/Users/eduardodeoliveirazaghi/Projects/loldesign/loldesign_publisher/app/assets/javascripts;T: filenameI"|/Users/eduardodeoliveirazaghi/Projects/loldesign/loldesign_publisher/app/assets/javascripts/loldesign_publisher/activable.js;T: nameI""loldesign_publisher/activable;T:logical_pathI"*loldesign_publisher/activable.self.js;T:content_typeI"application/javascript;T: sourceI"CjQuery(document).ready(function($) { new activableOption(); }); var activableOption = function(){ var _this = this; this.$links = $('.activable'); this.startup = function(){ if(!this.$links[0]){ return false; } this.$links.on('change', function(event) { event.preventDefault(); if($(this).is(':checked')){ _this.active($(this)); }else{ _this.inactive($(this)); } }); }, this.active = function($link){ $.ajax({ url: '/loldesign_publisher/activables/'+$link.data('resource')+'/'+$link.data('id')+'.json', type: 'POST', dataType: 'json' }) .done(function() { $link.val(true); }) .fail(function() { console.log("error"); }); }, this.inactive = function($link){ $.ajax({ url: '/loldesign_publisher/activables/'+$link.data('resource')+'/'+$link.data('id')+'.json', type: 'DELETE', dataType: 'json' }) .done(function() { $link.val(false); }) .fail(function() { console.log("error"); }); }, this.startup(); } ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"file-digest:///Users/eduardodeoliveirazaghi/Projects/loldesign/loldesign_publisher/app/assets/javascripts/loldesign_publisher/activable.js;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%!O9UwGFJB!QF/: lengthiC:dependencies_digest"%9= D#dh:뿡,>(:idI"E3f0dd6c9a4e383bec0b87d391b00f56e34d465cf90a50735cb5eb5d2df31b506;F: mtimel+#T