Sha256: 57b43144b72b73d5bca1f3bd4265186a74f4b59be5d2b3211bc45ce0eec4b196
Contents?: true
Size: 879 Bytes
Versions: 24
Compression:
Stored size: 879 Bytes
Contents
// short hand for $(document).ready(); $(function() { $('.trophy-class').click(function(){ var uid=$("#current_user").html(); $.ajax({ url:"/users/"+uid+"/trophy", type:"post", data: "file_id="+this.id, success:function(data) { var oldclass = $('#'+data.trophy.generic_file_id).find('i').attr("class"); if (oldclass.indexOf("trophy-on") != -1){ $('#'+data.trophy.generic_file_id).find('i').attr("title", "Highlight work"); } else { $('#'+data.trophy.generic_file_id).find('i').attr("title", "Unhighlight work"); } $('#'+data.trophy.generic_file_id).find('i').toggleClass("trophy-on"); $('#'+data.trophy.generic_file_id).find('i').toggleClass("trophy-off"); } }) }); }); //closing function at the top of the page
Version data entries
24 entries across 24 versions & 1 rubygems