Comments: Unbind event before binding
Prevents flashing of comments when posting
This commit is contained in:
parent
c6a138ff43
commit
e01f915abf
@ -100,8 +100,12 @@ script.
|
|||||||
});
|
});
|
||||||
|
|
||||||
{% if show_comments %}
|
{% if show_comments %}
|
||||||
$('body').on('pillar:comment-posted', function(e, comment_node_id) {
|
$('body')
|
||||||
|
.off('pillar:comment-posted')
|
||||||
|
.on('pillar:comment-posted', function(e, comment_node_id) {
|
||||||
|
|
||||||
var commentsUrl = "{{ url_for('nodes.comments_for_node', node_id=node_id) }}";
|
var commentsUrl = "{{ url_for('nodes.comments_for_node', node_id=node_id) }}";
|
||||||
|
|
||||||
loadComments(commentsUrl)
|
loadComments(commentsUrl)
|
||||||
.done(function() {
|
.done(function() {
|
||||||
$('#' + comment_node_id).scrollHere();
|
$('#' + comment_node_id).scrollHere();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user