Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
matrix-react-sdk
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Matrix.org
matrix-react-sdk
Commits
16846c36
Commit
16846c36
authored
10 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Handle default named rooms when editing room names
parent
89f64599
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
skins/base/views/molecules/RoomHeader.js
+5
-3
5 additions, 3 deletions
skins/base/views/molecules/RoomHeader.js
skins/base/views/organisms/RoomView.js
+1
-1
1 addition, 1 deletion
skins/base/views/organisms/RoomView.js
with
6 additions
and
4 deletions
skins/base/views/molecules/RoomHeader.js
+
5
−
3
View file @
16846c36
...
...
@@ -28,7 +28,7 @@ module.exports = React.createClass({
mixins
:
[
RoomHeaderController
],
onNameChange
:
function
(
new_name
)
{
if
(
this
.
props
.
room
.
name
!=
new_name
)
{
if
(
this
.
props
.
room
.
name
!=
new_name
&&
new_name
)
{
MatrixClientPeg
.
get
().
setRoomName
(
this
.
props
.
room
.
roomId
,
new_name
);
}
},
...
...
@@ -69,8 +69,10 @@ module.exports = React.createClass({
var
topic_el
=
null
;
var
save_button
=
null
;
var
settings_button
=
null
;
var
actual_name
=
this
.
props
.
room
.
currentState
.
getStateEvents
(
'
m.room.name
'
,
''
);
if
(
actual_name
)
actual_name
=
actual_name
.
getContent
().
name
;
if
(
this
.
props
.
editing
)
{
name
=
<
input
type
=
"
text
"
defaultValue
=
{
this
.
props
.
room
.
n
ame
}
ref
=
"
name_edit
"
/>
;
name
=
<
input
type
=
"
text
"
defaultValue
=
{
actual_name
}
placeHolder
=
"
N
ame
"
ref
=
"
name_edit
"
/>
;
// if (topic) topic_el = <div className="mx_RoomHeader_topic"><textarea>{ topic.getContent().topic }</textarea></div>
save_button
=
(
<
div
className
=
"
mx_RoomHeader_button
"
onClick
=
{
this
.
props
.
onSaveClick
}
>
...
...
@@ -78,7 +80,7 @@ module.exports = React.createClass({
<
/div
>
);
}
else
{
name
=
<
EditableText
initialValue
=
{
this
.
props
.
room
.
name
}
onValueChanged
=
{
this
.
onNameChange
}
/>
;
name
=
<
EditableText
label
=
{
this
.
props
.
room
.
name
}
initialValue
=
{
actual_name
}
placeHolder
=
"
Name
"
onValueChanged
=
{
this
.
onNameChange
}
/>
;
if
(
topic
)
topic_el
=
<
div
className
=
"
mx_RoomHeader_topic
"
>
{
topic
.
getContent
().
topic
}
<
/div>
;
settings_button
=
(
<
div
className
=
"
mx_RoomHeader_button
"
onClick
=
{
this
.
props
.
onSettingsClick
}
>
...
...
This diff is collapsed.
Click to expand it.
skins/base/views/organisms/RoomView.js
+
1
−
1
View file @
16846c36
...
...
@@ -83,7 +83,7 @@ module.exports = React.createClass({
var
deferreds
=
[];
if
(
old_name
!=
new_name
&&
new_name
!=
undefined
)
{
if
(
old_name
!=
new_name
&&
new_name
!=
undefined
&&
new_name
)
{
deferreds
.
push
(
MatrixClientPeg
.
get
().
setRoomName
(
this
.
state
.
room
.
roomId
,
new_name
)
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment