Sha256: 179cc318c4930682456809550e15c86e1ecbbd6909211dd1b12f6065a0d68e46

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

$(document).ready(function(){
  $(".asset").live("mouseenter",function(event){
    $(this).find(".asset_actions").fadeIn(150);
  });
  $(".asset").live("mouseleave",function(event){
    $(this).find(".asset_actions").fadeOut(100);
  });
  $(".put_on_tray_button").live("click", function(event){
    event.preventDefault();
    var user_id = $(event.target).data("user-id");
    var asset_id = $(event.target).data("asset-id");
    data = {tray_position: {asset_id: asset_id, user_id: user_id}};
    $.post("/users/"+user_id+"/tray_positions",data, function(){
      $("#tray").load("/users/"+user_id+"/tray_positions/", function() {
        $('#tray .drop_button').click(function(event){
          event.preventDefault();
          var user_id = $(event.target).data("user-id");
          var tp_id = $(event.target).data("tp-id");
          $.ajax({
            type: 'DELETE',
            cache	: false,
            url		: "/users/"+user_id+"/tray_positions/"+tp_id,
            success: function(data) {
              $("#tray").load("/users/"+user_id+"/tray_positions/");
            }
          });
        });
      });
    });
  });
});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fassets_core-0.4.0 app/assets/javascripts/fassets_core/assets.js
fassets_core-0.3.1 app/assets/javascripts/fassets_core/assets.js
fassets_core-0.3.0 app/assets/javascripts/fassets_core/assets.js
fassets_core-0.2.0 app/assets/javascripts/fassets_core/assets.js