You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-06-27 15:01:53 +03:00
Push up instantiation of TabComplete to RoomView
RoomView is the parent component which creates MessageComposer AND the status bar. By making RoomView instantiate TabComplete we can scope instances correctly rather than relying on singleton behaviour through dispatches. This also makes communication between status bar and the MessageComposer infinitely easier since they are now sharing the same TabComplete object.
This commit is contained in:
@ -34,6 +34,7 @@ var WhoIsTyping = require("../../WhoIsTyping");
|
||||
var Modal = require("../../Modal");
|
||||
var sdk = require('../../index');
|
||||
var CallHandler = require('../../CallHandler');
|
||||
var TabComplete = require("../../TabComplete");
|
||||
var Resend = require("../../Resend");
|
||||
var dis = require("../../dispatcher");
|
||||
|
||||
@ -85,6 +86,12 @@ module.exports = React.createClass({
|
||||
MatrixClientPeg.get().on("RoomState.members", this.onRoomStateMember);
|
||||
MatrixClientPeg.get().on("sync", this.onSyncStateChange);
|
||||
this.savedScrollState = {atBottom: true};
|
||||
// xchat-style tab complete, add a colon if tab
|
||||
// completing at the start of the text
|
||||
this.tabComplete = new TabComplete({
|
||||
startingWordSuffix: ": ",
|
||||
wordSuffix: " "
|
||||
});
|
||||
},
|
||||
|
||||
componentWillUnmount: function() {
|
||||
@ -1357,7 +1364,9 @@ module.exports = React.createClass({
|
||||
);
|
||||
if (canSpeak) {
|
||||
messageComposer =
|
||||
<MessageComposer room={this.state.room} roomView={this} uploadFile={this.uploadFile} callState={this.state.callState} />
|
||||
<MessageComposer
|
||||
room={this.state.room} roomView={this} uploadFile={this.uploadFile}
|
||||
callState={this.state.callState} tabComplete={this.tabComplete} />
|
||||
}
|
||||
|
||||
// TODO: Why aren't we storing the term/scope/count in this format
|
||||
|
Reference in New Issue
Block a user