You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
682 B

$(function(){
$(".new-player-twitter-btn").click(function(){
$(this).addClass("disabled");
var btn = $(this);
$.post("/teams/add-player", {
team: $(this).siblings(".new-player-twitter").data("team"),
twitter: $(this).siblings(".new-player-twitter").val()
}, function(response){
btn.removeClass("disabled");
if(response.error) {
btn.parent().addClass("has-error");
} else {
window.location.reload();
}
});
return false;
});
$("#add-team").click(function(){
$(this).addClass("disabled");
$.post("/teams/new", {
}, function(response){
window.location.reload();
});
});
});