mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 04:06:44 +02:00
show implicit names as placeholders if available
This commit is contained in:
parent
d39a9a0f18
commit
0cb6094992
@ -44,9 +44,11 @@ module.exports = React.createClass({
|
||||
componentWillReceiveProps: function(newProps) {
|
||||
if (newProps.editing) {
|
||||
var topic = this.props.room.currentState.getStateEvents('m.room.topic', '');
|
||||
var name = this.props.room.currentState.getStateEvents('m.room.name', '');
|
||||
|
||||
this.setState({
|
||||
name: this.props.room.name,
|
||||
name: name ? name.getContent().name : '',
|
||||
initialName: name ? name.getContent().name : '',
|
||||
topic: topic ? topic.getContent().topic : '',
|
||||
});
|
||||
}
|
||||
@ -119,12 +121,14 @@ module.exports = React.createClass({
|
||||
// </div>
|
||||
// if (topic) topic_el = <div className="mx_RoomHeader_topic"><textarea>{ topic.getContent().topic }</textarea></div>
|
||||
|
||||
var placeholderName = this.state.initialName ? "Unnamed Room" : this.props.room.name;
|
||||
|
||||
name =
|
||||
<div className="mx_RoomHeader_name">
|
||||
<EditableText
|
||||
className="mx_RoomHeader_nametext mx_RoomHeader_editable"
|
||||
placeholderClassName="mx_RoomHeader_placeholder"
|
||||
placeholder="Unnamed Room"
|
||||
placeholder={ placeholderName }
|
||||
blurToCancel={ false }
|
||||
onValueChanged={ this.onNameChanged }
|
||||
initialValue={ this.state.name }/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user