BF: edit the actual room name not the displayed room name (which has been computed)

This commit is contained in:
Emmanuel ROHEE 2014-09-17 15:46:12 +02:00
parent 9aed6a06cf
commit fe7af80198
2 changed files with 9 additions and 4 deletions

View File

@ -53,8 +53,13 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
return; return;
}; };
// Use the filter applied in html to set the input value var nameEvent = $rootScope.events.rooms[$scope.room_id]['m.room.name'];
$scope.name.newNameText = $filter('mRoomName')($scope.room_id); if (nameEvent) {
$scope.name.newNameText = nameEvent.content.name;
}
else {
$scope.name.newNameText = "";
}
// Force focus to the input // Force focus to the input
$timeout(function() { $timeout(function() {

View File

@ -9,7 +9,7 @@
{{ room_id | mRoomName }} {{ room_id | mRoomName }}
</div> </div>
<form ng-submit="name.updateName()" ng-show="name.isEditing" class="roomNameForm"> <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> </form>
</div> </div>
@ -23,7 +23,7 @@
{{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}} {{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}}
</div> </div>
<form ng-submit="topic.updateTopic()" ng-show="topic.isEditing" class="roomTopicForm"> <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> </form>
</div> </div>
</div> </div>