If you look at comment expand process with javascript debugger, you
will notice that at first comments get added to existing stream ("add"
event handler of model.comments gets launched because of model.comments.fetch).
Then the comment stream gets empty and then filled by the postRenderTemplate
handler.
This patch removes comments rerendering on the expansion. The fetching process is
changed so that older comments are added to the correct place, so the order
looks nice without rerendering. Thus, unnecessary job of rerendering is avoided.
28 lines
1 KiB
Handlebars
28 lines
1 KiB
Handlebars
<div class="show_comments comment {{#unless showExpandCommentsLink}} hidden {{/unless}}">
|
|
<div class="media">
|
|
<a href="/posts/{{id}}#comments" class="toggle_post_comments">
|
|
{{t "stream.more_comments" count=moreCommentsCount}}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="comments"> </div>
|
|
|
|
{{#if loggedIn}}
|
|
<div class="comment media new-comment-form-wrapper {{#unless commentsCount}} hidden {{/unless}}">
|
|
{{#with current_user}}
|
|
<a href="/people/{{guid}}" class="img">
|
|
{{{personImage this}}}
|
|
</a>
|
|
{{/with}}
|
|
|
|
<div class="bd">
|
|
<form accept-charset="UTF-8" action="/posts/{{id}}/comments" class="new_comment" id="new_comment_on_{{id}}" method="post">
|
|
<textarea class="comment_box form-control" id="comment_text_on_{{id}}" name="text" rows="1" required placeholder="{{t "stream.comment"}}" />
|
|
<div class="submit_button">
|
|
<input class="btn btn-primary" id="comment_submit_{{id}}" name="commit" type="submit" value="{{t "stream.comment"}}" />
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{{/if}}
|