summary refs log tree commit diff
path: root/webclient/app-directive.js
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2014-08-31 00:40:42 +0100
committerMatthew Hodgson <matthew@matrix.org>2014-08-31 00:40:42 +0100
commit1bc036a12d6877f78f1f5033603d803ac01a13d2 (patch)
tree00408a44816b73132c2aa640346733c3264eb47b /webclient/app-directive.js
parentfactor out mobile css into its own file (diff)
downloadsynapse-1bc036a12d6877f78f1f5033603d803ac01a13d2.tar.xz
nasty big monolithic commit of a whole bunch of UI/UX improvements:
 - add a simple CSS template across the app for navigation & cosmetics
 - split login into login & register, and totally reskin it
 - restructure room CSS to play nicely with it
 - implement basis 1:1 chat from user pages
 - disable autofocus on iOS to improve UX
Diffstat (limited to 'webclient/app-directive.js')
-rw-r--r--webclient/app-directive.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/webclient/app-directive.js b/webclient/app-directive.js
index 01f60fdadf..eee0d3842f 100644
--- a/webclient/app-directive.js
+++ b/webclient/app-directive.js
@@ -32,7 +32,12 @@ angular.module('matrixWebClient')
 .directive('ngFocus', ['$timeout', function($timeout) {
     return {
         link: function(scope, element, attr) {
-            $timeout(function() { element[0].focus(); }, 0);
+            // XXX: slightly evil hack to disable autofocus on iOS, as in general
+            // it causes more problems than it fixes, by bouncing the page
+            // around
+            if (!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)) {
+                $timeout(function() { element[0].focus(); }, 0);
+            }            
         }
     };
 }]);
\ No newline at end of file