From 011de75706ddd407cadfde89eec891b17db17211 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 20 Nov 2020 09:14:46 +0000 Subject: returning the rendered html when posting a comment will make the following update (and its implication in mod pubstream) obsolete --- view/js/main.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 09afb4da4..380b2bbf7 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1364,15 +1364,20 @@ function post_comment(id) { if(data.success) { localStorage.removeItem("comment_body-" + id); $("#comment-edit-preview-" + id).hide(); - $("#comment-edit-wrapper-" + id).hide(); - $("#comment-edit-text-" + id).val(''); + //$("#comment-edit-wrapper-" + id).hide(); + + $("#comment-edit-text-" + id).val('').blur().attr('placeholder', aStr.comment); var tarea = document.getElementById("comment-edit-text-" + id); if(tarea) { commentClose(tarea, id); $(document).unbind( "click.commentOpen"); } - if(timer) clearTimeout(timer); - timer = setTimeout(updateInit, 500); + + $('#wall-item-comment-wrapper-' + id).before(data.html); + $('#wall-item-ago-' + data.id + ' .autotime').timeago(); + $('body').css('cursor', 'unset'); + //if(timer) clearTimeout(timer); + //timer = setTimeout(updateInit, 500); } if(data.reload) { window.location.href=data.reload; -- cgit v1.2.3