Created
January 19, 2010 17:37
-
-
Save minimal/281112 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
success: function (data) { | |
//called when successful | |
if (data.length) { | |
// $.each(data, function (i, msg) { | |
// msg = $('<p/>').haml(message(msg)).html() | |
// $(msg).insertAfter('.queue_title') | |
// .animate({height: "toggle"}, 0).animate({height: "toggle"}, {queue: true}); | |
// }); | |
function make_caller_with_tail(msgs) { | |
var tail = msgs.slice(1); | |
return function() { | |
addmsgs(tail); | |
} | |
} | |
function addmsgs(msgs) { | |
if (msgs.length === 0) { | |
return | |
} | |
msg = $('<p/>').haml(message(msgs[0])).html() | |
$(msg).insertAfter('.queue_title') | |
.animate({height: "toggle"}, 0).animate({height: "toggle"}, make_caller_with_tail(msgs)); | |
} | |
addmsgs(data); | |
prettyPrint(); | |
//console.log("got data"); | |
retry('reset'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment