Sha256: 217cda3538d41533aed8e0efcf2976f50ca3c98480d65e8fd5355c5508224735

Contents?: true

Size: 1.58 KB

Versions: 20

Compression:

Stored size: 1.58 KB

Contents

{I"
class:ETI"BundledAsset;FI"logical_path;TI"%loldesign_publisher/activable.js;FI"
pathname;TI"|/Users/eduardodeoliveirazaghi/Projects/loldesign/loldesign_publisher/app/assets/javascripts/loldesign_publisher/activable.js;FI"content_type;TI"application/javascript;TI"
mtime;Tl+½#ęTI"length;TiEI"digest;TI"%26295560f5b7d6839dba9f6efdec6122;FI"source;TI"EjQuery(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();
}
;
;TI"required_assets_digest;TI"%5b49961e628f3f919a491ed604e4a302;FI"
_version;TI"%64e62ddc273c2f5847f30d698ca14b67;F

Version data entries

20 entries across 10 versions & 1 rubygems

Version Path
loldesign_publisher-2.0.0 spec/dummy/tmp/cache/assets/development/sprockets/76ac81439bcc037838020897dbc7abd2
loldesign_publisher-2.0.0 spec/dummy/tmp/cache/assets/development/sprockets/1f1bf3c50c408eadb8ee5d3a8a9fcf17
loldesign_publisher-1.5.1 spec/dummy/tmp/cache/assets/development/sprockets/76ac81439bcc037838020897dbc7abd2
loldesign_publisher-1.5.1 spec/dummy/tmp/cache/assets/development/sprockets/1f1bf3c50c408eadb8ee5d3a8a9fcf17
loldesign_publisher-1.5.0 spec/dummy/tmp/cache/assets/development/sprockets/1f1bf3c50c408eadb8ee5d3a8a9fcf17
loldesign_publisher-1.5.0 spec/dummy/tmp/cache/assets/development/sprockets/76ac81439bcc037838020897dbc7abd2
loldesign_publisher-1.4.0 spec/dummy/tmp/cache/assets/development/sprockets/76ac81439bcc037838020897dbc7abd2
loldesign_publisher-1.4.0 spec/dummy/tmp/cache/assets/development/sprockets/1f1bf3c50c408eadb8ee5d3a8a9fcf17
loldesign_publisher-1.3.6 spec/dummy/tmp/cache/assets/development/sprockets/1f1bf3c50c408eadb8ee5d3a8a9fcf17
loldesign_publisher-1.3.6 spec/dummy/tmp/cache/assets/development/sprockets/76ac81439bcc037838020897dbc7abd2
loldesign_publisher-1.3.4 spec/dummy/tmp/cache/assets/development/sprockets/76ac81439bcc037838020897dbc7abd2
loldesign_publisher-1.3.4 spec/dummy/tmp/cache/assets/development/sprockets/1f1bf3c50c408eadb8ee5d3a8a9fcf17
loldesign_publisher-1.3.3 spec/dummy/tmp/cache/assets/development/sprockets/1f1bf3c50c408eadb8ee5d3a8a9fcf17
loldesign_publisher-1.3.3 spec/dummy/tmp/cache/assets/development/sprockets/76ac81439bcc037838020897dbc7abd2
loldesign_publisher-1.3.2 spec/dummy/tmp/cache/assets/development/sprockets/76ac81439bcc037838020897dbc7abd2
loldesign_publisher-1.3.2 spec/dummy/tmp/cache/assets/development/sprockets/1f1bf3c50c408eadb8ee5d3a8a9fcf17
loldesign_publisher-1.3.1 spec/dummy/tmp/cache/assets/development/sprockets/76ac81439bcc037838020897dbc7abd2
loldesign_publisher-1.3.1 spec/dummy/tmp/cache/assets/development/sprockets/1f1bf3c50c408eadb8ee5d3a8a9fcf17
loldesign_publisher-1.3.0 spec/dummy/tmp/cache/assets/development/sprockets/76ac81439bcc037838020897dbc7abd2
loldesign_publisher-1.3.0 spec/dummy/tmp/cache/assets/development/sprockets/1f1bf3c50c408eadb8ee5d3a8a9fcf17