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 (
-
+
);
},
diff --git a/src/organisms/RoomView.js b/src/organisms/RoomView.js
index b587b5ca..0f4ef1a1 100644
--- a/src/organisms/RoomView.js
+++ b/src/organisms/RoomView.js
@@ -8,7 +8,7 @@ var MatrixClientPeg = require("../MatrixClientPeg");
module.exports = React.createClass({
getInitialState: function() {
return {
- room: MatrixClientPeg.get().getRoom(this.props.room_id)
+ room: MatrixClientPeg.get().getRoom(this.props.roomId)
}
},
@@ -22,14 +22,14 @@ module.exports = React.createClass({
componentWillReceiveProps: function(props) {
this.setState({
- room: MatrixClientPeg.get().getRoom(props.room_id)
+ room: MatrixClientPeg.get().getRoom(props.roomId)
});
},
onRoomTimeline: function(ev, room, toStartOfTimeline) {
- if (room.roomId != this.props.room_id) return;
+ if (room.roomId != this.props.roomId) return;
this.setState({
- room: MatrixClientPeg.get().getRoom(this.props.room_id)
+ room: MatrixClientPeg.get().getRoom(this.props.roomId)
});
},
@@ -48,7 +48,7 @@ module.exports = React.createClass({
-
+
);
},
diff --git a/src/pages/MatrixChat.js b/src/pages/MatrixChat.js
index cc29e277..7b260657 100644
--- a/src/pages/MatrixChat.js
+++ b/src/pages/MatrixChat.js
@@ -73,7 +73,7 @@ module.exports = React.createClass({
-
+
);
} else if (this.state.logged_in) {