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

  1. $(function(){
  2. $(".new-player-twitter-btn").click(function(){
  3. $(this).addClass("disabled");
  4. var btn = $(this);
  5. $.post("/teams/add-player", {
  6. team: $(this).siblings(".new-player-twitter").data("team"),
  7. twitter: $(this).siblings(".new-player-twitter").val()
  8. }, function(response){
  9. btn.removeClass("disabled");
  10. if(response.error) {
  11. btn.parent().addClass("has-error");
  12. } else {
  13. window.location.reload();
  14. }
  15. });
  16. return false;
  17. });
  18. $("#add-team").click(function(){
  19. $(this).addClass("disabled");
  20. $.post("/teams/new", {
  21. }, function(response){
  22. window.location.reload();
  23. });
  24. });
  25. });