spinner on saving room settings

This commit is contained in:
Matthew Hodgson 2016-04-12 18:01:49 +01:00
parent 1d5f234f2c
commit 3a2d5c4ba5
2 changed files with 11 additions and 0 deletions

View file

@ -860,6 +860,8 @@ module.exports = React.createClass({
},
onSettingsSaveClick: function() {
if (!this.refs.room_settings) return;
this.setState({
uploadingRoomSettings: true,
});
@ -1432,6 +1434,7 @@ module.exports = React.createClass({
<RoomHeader ref="header" room={this.state.room} searchInfo={searchInfo}
oobData={this.props.oobData}
editing={this.state.editingRoomSettings}
saving={this.state.uploadingRoomSettings}
onSearchClick={this.onSearchClick}
onSettingsClick={this.onSettingsClick}
onSaveClick={this.onSettingsSaveClick}

View file

@ -34,6 +34,7 @@ module.exports = React.createClass({
room: React.PropTypes.object,
oobData: React.PropTypes.object,
editing: React.PropTypes.bool,
saving: React.PropTypes.bool,
onSettingsClick: React.PropTypes.func,
onSaveClick: React.PropTypes.func,
onSearchClick: React.PropTypes.func,
@ -134,6 +135,7 @@ module.exports = React.createClass({
var searchStatus = null;
var topic_el = null;
var cancel_button = null;
var spinner = null;
var save_button = null;
var settings_button = null;
if (this.props.editing) {
@ -158,6 +160,11 @@ module.exports = React.createClass({
cancel_button = <div className="mx_RoomHeader_cancelButton" onClick={this.props.onCancelClick}><img src="img/cancel.svg" width="18" height="18" alt="Cancel"/> </div>
}
if (this.props.saving) {
var Spinner = sdk.getComponent("elements.Spinner");
spinner = <div className="mx_RoomHeader_spinner"><Spinner/></div>;
}
if (can_set_room_name) {
var RoomNameEditor = sdk.getComponent("rooms.RoomNameEditor");
name = <RoomNameEditor ref="nameEditor" room={this.props.room} />
@ -280,6 +287,7 @@ module.exports = React.createClass({
{ topic_el }
</div>
</div>
{spinner}
{save_button}
{cancel_button}
{right_row}