aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-11-20 09:14:46 +0000
committerMario <mario@mariovavti.com>2020-11-20 09:14:46 +0000
commit011de75706ddd407cadfde89eec891b17db17211 (patch)
tree64b97b6cbb24a6d4cc985dc6ebc79ba2199c5e41 /view
parent852e456d44d2bffeadd2a22a7d47bb9e2e7f125f (diff)
downloadvolse-hubzilla-011de75706ddd407cadfde89eec891b17db17211.tar.gz
volse-hubzilla-011de75706ddd407cadfde89eec891b17db17211.tar.bz2
volse-hubzilla-011de75706ddd407cadfde89eec891b17db17211.zip
returning the rendered html when posting a comment will make the following update (and its implication in mod pubstream) obsolete
Diffstat (limited to 'view')
-rw-r--r--view/js/main.js13
-rwxr-xr-xview/tpl/conv_item.tpl2
2 files changed, 10 insertions, 5 deletions
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;
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index d7eaefe7e..78601c40d 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -259,7 +259,7 @@
{{/foreach}}
{{/if}}
{{if $item.comment}}
- <div class="p-2 wall-item-comment-wrapper{{if $item.children}} wall-item-comment-wrapper-wc{{/if}}" >
+ <div id="wall-item-comment-wrapper-{{$item.id}}" class="p-2 wall-item-comment-wrapper{{if $item.children}} wall-item-comment-wrapper-wc{{/if}}" >
{{$item.comment}}
</div>
{{/if}}