summary refs log tree commit diff
path: root/webclient
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-11 11:49:59 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-11 11:49:59 +0200
commitaf44e9556d7f2aab93b96f11eef02d23cb65ac8e (patch)
tree5e3f43970e87e16600a846ebcb7b9a9005a7013d /webclient
parentShow room topic change in the chat history and in the recents (diff)
downloadsynapse-af44e9556d7f2aab93b96f11eef02d23cb65ac8e.tar.xz
BF: made input autofocus work when opening the room topic input
Diffstat (limited to 'webclient')
-rw-r--r--webclient/room/room-controller.js5
-rw-r--r--webclient/room/room.html3
2 files changed, 6 insertions, 2 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index 0000fcfc61..94c7688907 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -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() {
diff --git a/webclient/room/room.html b/webclient/room/room.html
index dba6586e00..587b0057a6 100644
--- a/webclient/room/room.html
+++ b/webclient/room/room.html
@@ -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>