1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-10 09:22:25 +03:00

click on nicks to insert them into the MessageComposer

This commit is contained in:
Matthew Hodgson
2016-03-17 15:35:23 +00:00
parent a13513935b
commit c7ffb59374
2 changed files with 20 additions and 4 deletions

View File

@@ -196,6 +196,15 @@ module.exports = React.createClass({
case 'focus_composer':
this.refs.textarea.focus();
break;
case 'insert_displayname':
if (this.refs.textarea.value) {
this.refs.textarea.value =
this.refs.textarea.value.replace(/( ?)$/, " " + payload.displayname);
}
else {
this.refs.textarea.value = payload.displayname + ": ";
}
break;
}
},