Use function to load a reply after posting a reply.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 25 Nov 2010 12:01:12 +0000 (13:01 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 25 Nov 2010 12:01:12 +0000 (13:01 +0100)
src/main/resources/static/javascript/sone.js

index 133e1d4..8a64118 100644 (file)
@@ -453,11 +453,8 @@ function ajaxifyPost(postElement) {
                $(inputField).val("");
                postReply(postId, text, function(success, error, replyId) {
                        if (success) {
-                               getReply(replyId, function(soneId, soneName, replyTime, replyDisplayTime, text, html) {
-                                       newReply = $(html).insertBefore("#sone .post#" + postId + " .create-reply");
-                                       $("#sone .post#" + postId + " .create-reply").addClass("hidden");
-                                       ajaxifyReply(newReply);
-                               });
+                               loadNewReply(replyId);
+                               $("#sone .post#" + postId + " .create-reply").addClass("hidden");
                        } else {
                                alert(error);
                        }