Permalink
Browse files

Animate input asynchronously

  • Loading branch information...
1 parent 094eb6a commit 6b0ed40fe9b4185ef7feafb477b1fd591625c5bf @graingert committed Apr 11, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 static/js/main.js
View
@@ -64,15 +64,17 @@ function loggedIn(email, immediate) {
function save(event) {
event.preventDefault();
+ var input = $("#content input")
+ input.fadeOut(200);
$.ajax({
type: 'POST',
url: '/api/set',
- data: { beer: $("input").val() },
+ data: { beer: input.val() },
success: function(res, status, xhr) {
- // noop
+ input.stop(true,true);
+ input.fadeIn(400);
}
});
- $("#content input").fadeOut(200).fadeIn(400);
}
// when the user clicks logout, we'll make a call to the server to clear

0 comments on commit 6b0ed40

Please sign in to comment.