mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-31 15:09:32 +00:00
chat: allow delete message
This commit is contained in:
parent
cd264d702a
commit
2e61d3f1ea
2 changed files with 3 additions and 0 deletions
|
|
@ -130,6 +130,8 @@ module.exports.app = (appExports, model, app) ->
|
|||
return next() unless e.keyCode is 13
|
||||
appExports.tavernSendChat()
|
||||
|
||||
appExports.deleteChatMessage = (e) -> e.at().remove() #requires the {#with}
|
||||
|
||||
app.on 'render', (ctx) ->
|
||||
$('#party-tab-link').on 'shown', (e) ->
|
||||
messages = model.get('_party.chat')
|
||||
|
|
|
|||
|
|
@ -63,5 +63,6 @@
|
|||
class="label {{#if @message.npc}}label-success{{else if @message.contributor}}label-inverse{{else if equal(@message.uuid,_user.id)}}label-info{{/}} chat-message"
|
||||
rel='tooltip' title="{{@message.contributor}}{{@message.npc}}">
|
||||
{{@message.user}}</span> {{@message.text}} - <span class='muted time'>{relativeDate(@message.timestamp, _currentTime)}
|
||||
{{#if equal(@message.uuid,_user.id)}}{{#with @message}}<a x-bind="click:deleteChatMessage"><i rel=tooltip title=Delete class=icon-remove></i></a>{{/}}{{/}}
|
||||
</span>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Reference in a new issue