Skip to content
Snippets Groups Projects
Commit 7c2d680b authored by Oliver Jägle's avatar Oliver Jägle Committed by Douglas Gubert
Browse files

[NEW] Add message action to copy message to input as reply (#12626)

parent c98fd210
No related branches found
No related tags found
No related merge requests found
......@@ -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}}
......@@ -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}}
......
......@@ -7,4 +7,7 @@ Template.messageAction.helpers({
areButtonsHorizontal() {
return Template.parentData(1).button_alignment === 'horizontal';
},
jsActionButtonClassname(processingType) {
return `js-actionButton-${ processingType || 'sendMessage' }`;
},
});
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment