summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-17 15:46:12 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-17 15:46:12 +0200
commitfe7af80198de6a668f07158d725c4bf57941ecde (patch)
tree4a1a3648c5439e476aa471e67a797bef3d86f3ac
parentSYWEB-15: Always show the room alias as well as its name in the UI (diff)
downloadsynapse-fe7af80198de6a668f07158d725c4bf57941ecde.tar.xz
BF: edit the actual room name not the displayed room name (which has been computed)
-rw-r--r--webclient/room/room-controller.js9
-rw-r--r--webclient/room/room.html4
2 files changed, 9 insertions, 4 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index 45f2422c90..fb6ead5435 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -53,8 +53,13 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
                 return;
             };
 
-            // Use the filter applied in html to set the input value
-            $scope.name.newNameText = $filter('mRoomName')($scope.room_id);
+            var nameEvent = $rootScope.events.rooms[$scope.room_id]['m.room.name'];
+            if (nameEvent) {
+                $scope.name.newNameText = nameEvent.content.name;
+            }
+            else {
+                $scope.name.newNameText = "";
+            }
 
             // Force focus to the input
             $timeout(function() {
diff --git a/webclient/room/room.html b/webclient/room/room.html
index 33ad06ea80..fc22db7610 100644
--- a/webclient/room/room.html
+++ b/webclient/room/room.html
@@ -9,7 +9,7 @@
                     {{ room_id | mRoomName }}
                 </div>
                 <form ng-submit="name.updateName()" ng-show="name.isEditing" class="roomNameForm">
-                    <input ng-model="name.newNameText" ng-blur="name.cancelEdit()" class="roomNameInput" />
+                    <input ng-model="name.newNameText" ng-blur="name.cancelEdit()" class="roomNameInput" placeholder="Room name"/>
                 </form>
             </div>
 
@@ -23,7 +23,7 @@
                         {{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}}
                     </div>
                     <form ng-submit="topic.updateTopic()" ng-show="topic.isEditing" class="roomTopicForm">
-                        <input ng-model="topic.newTopicText" ng-blur="topic.cancelEdit()" class="roomTopicInput" />
+                        <input ng-model="topic.newTopicText" ng-blur="topic.cancelEdit()" class="roomTopicInput"  placeholder="Topic"/>
                     </form>
                 </div>
             </div>