diff --git a/src/molecules/MessageComposer.js b/src/molecules/MessageComposer.js index 0782797d..f3a554ff 100644 --- a/src/molecules/MessageComposer.js +++ b/src/molecules/MessageComposer.js @@ -3,12 +3,22 @@ var React = require('react'); var MatrixClientPeg = require("../MatrixClientPeg"); module.exports = React.createClass({ + onKeyDown: function (ev) { + if (ev.keyCode == 13) { + var contentText = this.refs.textarea.getDOMNode().value; + MatrixClientPeg.get().sendMessage(this.props.roomId, { + msgtype: 'm.text', + body: contentText + }); + this.refs.textarea.getDOMNode().value = ''; + ev.preventDefault(); + } + }, + render: function() { return (
-
-