mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
put cancel & save buttons into the roomheader
This commit is contained in:
parent
bf10a03ab1
commit
5153954a28
@ -67,6 +67,7 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
var name = null;
|
var name = null;
|
||||||
var topic_el = null;
|
var topic_el = null;
|
||||||
|
var cancel_button = null;
|
||||||
var save_button = null;
|
var save_button = null;
|
||||||
var settings_button = null;
|
var settings_button = null;
|
||||||
var actual_name = this.props.room.currentState.getStateEvents('m.room.name', '');
|
var actual_name = this.props.room.currentState.getStateEvents('m.room.name', '');
|
||||||
@ -77,6 +78,8 @@ module.exports = React.createClass({
|
|||||||
<input className="mx_RoomHeader_nameInput" type="text" defaultValue={actual_name} placeholder="Name" ref="name_edit"/>
|
<input className="mx_RoomHeader_nameInput" type="text" defaultValue={actual_name} placeholder="Name" ref="name_edit"/>
|
||||||
</div>
|
</div>
|
||||||
// if (topic) topic_el = <div className="mx_RoomHeader_topic"><textarea>{ topic.getContent().topic }</textarea></div>
|
// if (topic) topic_el = <div className="mx_RoomHeader_topic"><textarea>{ topic.getContent().topic }</textarea></div>
|
||||||
|
cancel_button = <div className="mx_RoomHeader_textButton" onClick={this.props.onCancelClick}>Cancel</div>
|
||||||
|
save_button = <div className="mx_RoomHeader_textButton" onClick={this.props.onSaveClick}>Save Changes</div>
|
||||||
} else {
|
} else {
|
||||||
name =
|
name =
|
||||||
<div className="mx_RoomHeader_name">
|
<div className="mx_RoomHeader_name">
|
||||||
@ -102,6 +105,8 @@ module.exports = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{callButtons}
|
{callButtons}
|
||||||
|
{cancel_button}
|
||||||
|
{save_button}
|
||||||
<div className="mx_RoomHeader_rightRow">
|
<div className="mx_RoomHeader_rightRow">
|
||||||
{ settings_button }
|
{ settings_button }
|
||||||
<div className="mx_RoomHeader_button mx_RoomHeader_search">
|
<div className="mx_RoomHeader_button mx_RoomHeader_search">
|
||||||
|
@ -207,12 +207,6 @@ module.exports = React.createClass({
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mx_RoomSettings_buttons">
|
|
||||||
<div className="mx_RoomSettings_button" onClick={this.props.onSaveClick}>
|
|
||||||
Save this room
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,10 @@ module.exports = React.createClass({
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onCancelClick: function() {
|
||||||
|
this.setState(this.getInitialState());
|
||||||
|
},
|
||||||
|
|
||||||
getUnreadMessagesString: function() {
|
getUnreadMessagesString: function() {
|
||||||
if (!this.state.numUnreadMessages) {
|
if (!this.state.numUnreadMessages) {
|
||||||
return "";
|
return "";
|
||||||
@ -163,7 +167,7 @@ module.exports = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<div className="mx_RoomView">
|
<div className="mx_RoomView">
|
||||||
<RoomHeader ref="header" room={this.state.room} editing={this.state.editingRoomSettings}
|
<RoomHeader ref="header" room={this.state.room} editing={this.state.editingRoomSettings}
|
||||||
onSettingsClick={this.onSettingsClick}/>
|
onSettingsClick={this.onSettingsClick} onSaveClick={this.onSaveClick} onCancelClick={this.onCancelClick} />
|
||||||
<div className="mx_RoomView_auxPanel">
|
<div className="mx_RoomView_auxPanel">
|
||||||
<CallView room={this.state.room}/>
|
<CallView room={this.state.room}/>
|
||||||
{ roomEdit }
|
{ roomEdit }
|
||||||
|
Loading…
Reference in New Issue
Block a user