Browse Source

Fix intercooler targeting for .comment-itself

The functions that target a comment's .comment-itself div (editing,
voting, deleting) were nesting an additional .comment-itself inside it,
instead of replacing the existing one.
merge-requests/25/head
Deimos 6 years ago
parent
commit
e1b35cdb1a
  1. 2
      tildes/tildes/templates/intercooler/comment_edit.jinja2
  2. 3
      tildes/tildes/templates/macros/comments.jinja2

2
tildes/tildes/templates/intercooler/comment_edit.jinja2

@ -8,6 +8,7 @@
comment_id36=comment.comment_id36,
) }}"
data-ic-target="#comment-{{ comment.comment_id36 }} .comment-itself:first"
data-ic-replace-target="true"
data-js-confirm-leave-page-unsaved
>
{{ markdown_textarea(
@ -25,6 +26,7 @@
comment_id36=comment.comment_id36,
) }}"
data-ic-target="#comment-{{ comment.comment_id36 }} .comment-itself:first"
data-ic-replace-target="true"
>Cancel</button>
</div>
</form>

3
tildes/tildes/templates/macros/comments.jinja2

@ -115,6 +115,7 @@
comment_id36=comment.comment_id36,
) }}"
data-ic-target="#comment-{{ comment.comment_id36 }} .comment-itself:first"
data-ic-replace-target="true"
>Voted
{% else %}
<li><a class="post-button" name="vote"
@ -123,6 +124,7 @@
comment_id36=comment.comment_id36,
) }}"
data-ic-target="#comment-{{ comment.comment_id36 }} .comment-itself:first"
data-ic-replace-target="true"
>Vote
{% endif %}
{% if comment.num_votes > 0 %}
@ -153,6 +155,7 @@
comment_id36=comment.comment_id36,
) }}"
data-ic-target="#comment-{{ comment.comment_id36 }} .comment-itself:first"
data-ic-replace-target="true"
data-ic-confirm="Delete this comment? This cannot be undone."
>Delete</a></li>
{% endif %}

Loading…
Cancel
Save