BF: made input autofocus work when opening the room topic input

pull/4/merge
Emmanuel ROHEE 10 years ago
parent 7e7eb0efc1
commit af44e9556d
  1. 5
      webclient/room/room-controller.js
  2. 3
      webclient/room/room.html

@ -58,6 +58,11 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
$scope.topic.newTopicText = "";
}
// Force focus to the input
$timeout(function() {
angular.element('.roomTopicInput').focus();
}, 0);
$scope.topic.isEditing = true;
},
updateTopic: function() {

@ -16,8 +16,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"
autofocus />
<input ng-model="topic.newTopicText" ng-blur="topic.cancelEdit()" class="roomTopicInput" />
</form>
</div>
</div>

Loading…
Cancel
Save