mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
fix up Start Chat behaviour as per Amandine's feedback
This commit is contained in:
parent
35c141cda9
commit
deca90d0a7
5 changed files with 23 additions and 12 deletions
|
@ -375,7 +375,7 @@ module.exports = React.createClass({
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'view_room',
|
action: 'view_room',
|
||||||
room_id: res.room_id,
|
room_id: res.room_id,
|
||||||
show_settings: true,
|
// show_settings: true,
|
||||||
});
|
});
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
modal.close();
|
modal.close();
|
||||||
|
|
|
@ -457,6 +457,15 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
|
|
||||||
this._updateTabCompleteList(this.state.room);
|
this._updateTabCompleteList(this.state.room);
|
||||||
|
|
||||||
|
// XXX: EVIL HACK to autofocus inviting on empty rooms.
|
||||||
|
// We use the setTimeout to avoid racing with focus_composer.
|
||||||
|
if (this.state.room && this.state.room.getJoinedMembers().length == 1) {
|
||||||
|
var inviteBox = document.getElementById("mx_SearchableEntityList_query");
|
||||||
|
setTimeout(function() {
|
||||||
|
inviteBox.focus();
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateTabCompleteList: function(room) {
|
_updateTabCompleteList: function(room) {
|
||||||
|
|
|
@ -190,7 +190,7 @@ module.exports = React.createClass({
|
||||||
var can_set_room_topic = current_user_level >= room_topic_level;
|
var can_set_room_topic = current_user_level >= room_topic_level;
|
||||||
|
|
||||||
var placeholderName = "Unnamed Room";
|
var placeholderName = "Unnamed Room";
|
||||||
if (this.state.defaultName && this.state.defaultName !== '?') {
|
if (this.state.defaultName && this.state.defaultName !== 'Empty room') {
|
||||||
placeholderName += " (" + this.state.defaultName + ")";
|
placeholderName += " (" + this.state.defaultName + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,9 +218,19 @@ module.exports = React.createClass({
|
||||||
searchStatus = <div className="mx_RoomHeader_searchStatus"> (~{ this.props.searchInfo.searchCount } results)</div>;
|
searchStatus = <div className="mx_RoomHeader_searchStatus"> (~{ this.props.searchInfo.searchCount } results)</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX: this is a bit inefficient - we could just compare room.name for 'Empty room'...
|
||||||
|
var members = this.props.room.getJoinedMembers();
|
||||||
|
var settingsHint = false;
|
||||||
|
if (members.length === 1 && members[0].userId === MatrixClientPeg.get().credentials.userId) {
|
||||||
|
var name = this.props.room.currentState.getStateEvents('m.room.name', '');
|
||||||
|
if (!name || !name.getContent().name) {
|
||||||
|
settingsHint = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
name =
|
name =
|
||||||
<div className="mx_RoomHeader_name" onClick={this.props.onSettingsClick}>
|
<div className="mx_RoomHeader_name" onClick={this.props.onSettingsClick}>
|
||||||
<div className="mx_RoomHeader_nametext" title={ this.props.room.name }>{ this.props.room.name }</div>
|
<div className={ "mx_RoomHeader_nametext " + (settingsHint ? "mx_RoomHeader_settingsHint" : "") } title={ this.props.room.name }>{ this.props.room.name }</div>
|
||||||
{ searchStatus }
|
{ searchStatus }
|
||||||
<div className="mx_RoomHeader_settingsButton" title="Settings">
|
<div className="mx_RoomHeader_settingsButton" title="Settings">
|
||||||
<TintableSvg src="img/settings.svg" width="12" height="12"/>
|
<TintableSvg src="img/settings.svg" width="12" height="12"/>
|
||||||
|
|
|
@ -43,14 +43,6 @@ module.exports = React.createClass({
|
||||||
onCancelClick: React.PropTypes.func,
|
onCancelClick: React.PropTypes.func,
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
|
||||||
// XXX: dirty hack to gutwrench to focus on the invite box
|
|
||||||
if (this.props.room.getJoinedMembers().length == 1) {
|
|
||||||
var inviteBox = document.getElementById("mx_MemberList_invite");
|
|
||||||
if (inviteBox) setTimeout(function() { inviteBox.focus(); }, 0);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
// work out the initial color index
|
// work out the initial color index
|
||||||
var room_color_index = undefined;
|
var room_color_index = undefined;
|
||||||
|
|
|
@ -96,7 +96,7 @@ var SearchableEntityList = React.createClass({
|
||||||
if (this.props.showInputBox) {
|
if (this.props.showInputBox) {
|
||||||
inputBox = (
|
inputBox = (
|
||||||
<form onSubmit={this.onQuerySubmit}>
|
<form onSubmit={this.onQuerySubmit}>
|
||||||
<input className="mx_SearchableEntityList_query" type="text"
|
<input className="mx_SearchableEntityList_query" id="mx_SearchableEntityList_query" type="text"
|
||||||
onChange={this.onQueryChanged} value={this.state.query}
|
onChange={this.onQueryChanged} value={this.state.query}
|
||||||
placeholder={this.props.searchPlaceholderText} />
|
placeholder={this.props.searchPlaceholderText} />
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in a new issue