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");
if (postId in loadedPosts) {
return;
}
- loadedPosts[postId] = true;
$.getJSON("getPost.ajax", { "post" : postId }, function(data, textStatus) {
+ if (postId in loadedPosts) {
+ return;
+ }
+ loadedPosts[postId] = true;
if ((data != null) && data.success) {
if (!isIndexPage() && !(isViewSonePage() && ((getShownSoneId() == data.post.sone) || (getShownSoneId() == data.post.recipient)))) {
return;
if (replyId in loadedReplies) {
return;
}
- loadedReplies[replyId] = true;
$.getJSON("getReply.ajax", { "reply": replyId }, function(data, textStatus) {
+ if (replyId in loadedReplies) {
+ return;
+ }
+ loadedReplies[replyId] = true;
/* find post. */
if ((data != null) && data.success) {
$("#sone .post#" + data.reply.postId).each(function() {
ajaxifyReply(newReply);
newReply.slideDown();
setActivity();
+ return false;
});
}
});