Skip to content

Commit

Permalink
refactor: remove answer withSelection (#1219)
Browse files Browse the repository at this point in the history
it doesn't work
  • Loading branch information
nlopin authored Jun 26, 2024
1 parent a0c5a45 commit bb7cb42
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion frontend/html/comments/types/battle.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
{% endif %}

{% if me and me.is_active_membership and comment.post.is_commentable %}
<span class="comment-footer-button" v-on:click="showReplyForm('{{ comment.id }}', '', true)"><i class="fas fa-reply"></i>&nbsp;ответить</span>
<span class="comment-footer-button" v-on:click="showReplyForm('{{ comment.id }}', '')"><i class="fas fa-reply"></i>&nbsp;ответить</span>
{% endif %}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/html/comments/types/bold.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
{% endif %}

{% if me and me.is_active_membership and comment.post.is_commentable %}
<span class="comment-footer-button" v-on:click="showReplyForm('{{ comment.id }}', '{{ comment.author.slug }}', true)"><i class="fas fa-reply"></i>&nbsp;ответить</span>
<span class="comment-footer-button" v-on:click="showReplyForm('{{ comment.id }}', '{{ comment.author.slug }}')"><i class="fas fa-reply"></i>&nbsp;ответить</span>
{% endif %}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/html/comments/types/normal.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
{% endif %}

{% if me and me.is_active_membership and comment.post.is_commentable %}
<span class="comment-footer-button" v-on:click="showReplyForm('{{ comment.id }}', '{{ comment.author.slug }}', true)"><i class="fas fa-reply"></i>&nbsp;ответить</span>
<span class="comment-footer-button" v-on:click="showReplyForm('{{ comment.id }}', '{{ comment.author.slug }}')"><i class="fas fa-reply"></i>&nbsp;ответить</span>
{% endif %}
</div>

Expand Down
2 changes: 1 addition & 1 deletion frontend/html/comments/types/reply.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
{% endif %}

{% if me and me.is_active_membership and comment.post.is_commentable %}
<span class="comment-footer-button" v-on:click="showReplyForm('{{ reply_to.id }}', '{{ comment.author.slug }}', true)">
<span class="comment-footer-button" v-on:click="showReplyForm('{{ reply_to.id }}', '{{ comment.author.slug }}')">
<i class="fas fa-reply"></i>&nbsp;ответить
</span>
{% endif %}
Expand Down
11 changes: 0 additions & 11 deletions frontend/static/js/components/ReplyContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,6 @@ export default {
if (username !== null && username !== "") {
this.appendMarkdownTextareaValue("@" + username + ", ");
}
// Add selected text as quote
const withSelection = this.replyTo.withSelection
if (withSelection) {
const selectedText = window.getSelection().toString();
if (selectedText !== null && selectedText !== "") {
this.appendMarkdownTextareaValue("\n> " + selectedText + "\n\n");
}
}
this.appendMarkdownTextareaValue("");
}
editor.focus()
Expand Down
4 changes: 2 additions & 2 deletions frontend/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ new Vue({
window.scrollBy(0, commentPosition.top);
}
},
showReplyForm(commentId, username, withSelection) {
this.replyTo = { commentId, username, withSelection }
showReplyForm(commentId, username) {
this.replyTo = { commentId, username }
},
},
});

0 comments on commit bb7cb42

Please sign in to comment.