Only clear the input field if the reply was posted.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 30 Nov 2010 17:03:41 +0000 (18:03 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 30 Nov 2010 17:03:41 +0000 (18:03 +0100)
src/main/resources/static/javascript/sone.js

index 33f45df..69c11e0 100644 (file)
@@ -449,9 +449,9 @@ function ajaxifyPost(postElement) {
                inputField = $(this.form).find(":input:enabled").get(0);
                postId = getPostId(this);
                text = $(inputField).val();
-               $(inputField).val("");
                postReply(postId, text, function(success, error, replyId) {
                        if (success) {
+                               $(inputField).val("");
                                loadNewReply(replyId);
                                markPostAsKnown(getPostElement(inputField));
                                $("#sone .post#" + postId + " .create-reply").addClass("hidden");