Add ability to edit room settings

This commit is contained in:
Erik Johnston 2015-07-20 15:07:51 +01:00
parent 87dd9e8bb4
commit 0039ccf203
6 changed files with 125 additions and 16 deletions

View file

@ -92,6 +92,7 @@ require('../skins/base/views/molecules/UserSelector');
require('../skins/base/views/organisms/UserSettings');
require('../skins/base/views/molecules/ChangeAvatar');
require('../skins/base/views/molecules/ChangePassword');
require('../skins/base/views/molecules/RoomSettings');
// new for vector
require('../skins/base/views/organisms/LeftPanel');
require('../skins/base/views/organisms/RightPanel');

View file

@ -21,10 +21,25 @@ limitations under the License.
* this.state.call_state = the UI state of the call (see CallHandler)
*/
var React = require('react');
var dis = require("../../dispatcher");
var CallHandler = require("../../CallHandler");
module.exports = {
propTypes: {
room: React.PropTypes.object.isRequired,
editing: React.PropTypes.bool,
onSettingsClick: React.PropTypes.func,
onSaveClick: React.PropTypes.func,
},
getDefaultProps: function() {
return {
editing: false,
onSettingsClick: function() {},
onSaveClick: function() {},
};
},
componentDidMount: function() {
this.dispatcherRef = dis.register(this.onAction);
@ -43,7 +58,7 @@ module.exports = {
onAction: function(payload) {
// if we were given a room_id to track, don't handle anything else.
if (payload.room_id && this.props.room &&
if (payload.room_id && this.props.room &&
this.props.room.roomId !== payload.room_id) {
return;
}
@ -78,4 +93,3 @@ module.exports = {
});
}
};

View file

@ -44,7 +44,8 @@ module.exports = {
getInitialState: function() {
return {
room: this.props.roomId ? MatrixClientPeg.get().getRoom(this.props.roomId) : null,
messageCap: INITIAL_SIZE
messageCap: INITIAL_SIZE,
editingRoomSettings: false,
}
},
@ -99,7 +100,7 @@ module.exports = {
// we'll only be showing a spinner.
if (this.state.joining) return;
if (room.roomId != this.props.roomId) return;
if (this.refs.messageWrapper) {
var messageWrapper = this.refs.messageWrapper.getDOMNode();
this.atBottom = messageWrapper.scrollHeight - messageWrapper.scrollTop <= messageWrapper.clientHeight;
@ -300,7 +301,7 @@ module.exports = {
dateSeparator = <DateSeparator key={ts1} ts={ts1}/>;
continuation = false;
}
}
}
if (!TileType) continue;
ret.unshift(
<TileType key={mxEv.getId()} mxEvent={mxEv} continuation={continuation} last={last}/>
@ -313,4 +314,3 @@ module.exports = {
return ret;
}
};