Add str ' @someone ' if REPLY clicked. (#212)

1. Implements #156.1
This commit is contained in:
cryptogun 2018-01-31 01:08:05 +08:00 committed by Esteban Castro Borsani
parent ff5c9fe3bb
commit 9a4064ac28
2 changed files with 7 additions and 1 deletions

View File

@ -69,7 +69,7 @@
{% ifnotequal c.user.pk user.pk %}
<li><a href="{% url "spirit:comment:publish" topic_id=topic.pk pk=c.pk %}" >{% trans "quote" %}</a></li>
<li><a href="#reply" >{% trans "reply" %}</a></li>
<li><a href="#reply" class="js-reply-button" data="@{{ c.user.username }}" >{% trans "reply" %}</a></li>
{% endifnotequal %}
{% endif %}
</ul>

View File

@ -37,6 +37,7 @@ class Editor
$('.js-box-image').on('click', @addImage)
$('.js-box-poll').on('click', @addPoll)
$('.js-box-preview').on('click', @togglePreview)
$('.js-reply-button').on('click', @replyButton)
wrapSelection: (preTxt, postTxt, defaultTxt) =>
preSelection = @el
@ -99,6 +100,11 @@ class Editor
return false
replyButton: (e) =>
@wrapSelection(" ", " ", $(e.currentTarget).attr("data"))
$('#id_comment').focus()
return false
$.fn.extend
editor: (options) ->