Skip to content

Commit

Permalink
[NEW] Add message action to copy message to input as reply (#12626)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimpson authored and d-gubert committed Mar 27, 2019
1 parent c98fd21 commit 7c2d680
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/message-action/client/messageAction.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{/if}}

{{#if msg_in_chat_window}}
<button class="js-actionButton-sendMessage" value="{{msg}}">
<button class="{{jsActionButtonClassname msg_processing_type}}" value="{{msg}}">
<img class="image-button" src="{{image_url}}" />
</button>
{{/if}}
Expand All @@ -21,7 +21,7 @@
</a>
{{/if}}
{{#if msg_in_chat_window}}
<button class="text-button js-actionButton-sendMessage" value="{{msg}}">
<button class="text-button {{jsActionButtonClassname msg_processing_type}}" value="{{msg}}">
<span class="overflow-ellipsis">{{text}}</span>
</button>
{{/if}}
Expand Down
3 changes: 3 additions & 0 deletions app/message-action/client/messageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ Template.messageAction.helpers({
areButtonsHorizontal() {
return Template.parentData(1).button_alignment === 'horizontal';
},
jsActionButtonClassname(processingType) {
return `js-actionButton-${ processingType || 'sendMessage' }`;
},
});
10 changes: 10 additions & 0 deletions app/ui/client/views/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,16 @@ Template.room.events({
Meteor.call('sendMessage', msgObject);
});
},
'click .js-actionButton-respondWithMessage'(event) {
const msg = event.currentTarget.value;
if (!msg) {
return;
}

const { input } = chatMessages[RoomManager.openedRoom];
input.value = msg;
input.focus();
},
'click .js-navigate-to-discussion'(event) {
event.preventDefault();
const [, { drid }] = this._arguments;
Expand Down

0 comments on commit 7c2d680

Please sign in to comment.