From: David ‘Bombe’ Roden Date: Tue, 30 Nov 2010 17:03:41 +0000 (+0100) Subject: Only clear the input field if the reply was posted. X-Git-Tag: 0.3.2-RC3~2 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b360b7b166a51bf2161e5a051b0ae3d12c7bcba5;p=Sone.git Only clear the input field if the reply was posted. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 33f45df..69c11e0 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -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");