Let the comment form remain when posting a top-level comment.

This commit is contained in:
Fredrik Wallgren 2014-08-16 16:47:24 +02:00
parent 94716a0dcb
commit 9a774d082d

View file

@ -171,7 +171,12 @@ var _Lobsters = Class.extend({
postComment: function(form) {
$.post($(form).attr("action"), $(form).serializeArray(), function(data) {
$(form).closest('.comment').replaceWith($.parseHTML(data));
if ($(form).find('#parent_comment_short_id').length) {
$(form).closest('.comment').replaceWith($.parseHTML(data));
} else {
$(form).closest('.comment').after($.parseHTML(data));
$(form).find('textarea').val('');
}
});
},