diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-10-30 13:24:40 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-10-30 13:24:40 +0000 |
commit | 6f3f631fd11f744afa57396e8dd18e064ce90e8f (patch) | |
tree | 9552b7379bc536b42ec0a66ea6bc8c27c3a14e44 /webclient/app-directive.js | |
parent | SYWEB-12: Format room info dialog better. (diff) | |
download | synapse-6f3f631fd11f744afa57396e8dd18e064ce90e8f.tar.xz |
SYWEB-12: More formatting.
Diffstat (limited to 'webclient/app-directive.js')
-rw-r--r-- | webclient/app-directive.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/webclient/app-directive.js b/webclient/app-directive.js index 75283598ab..d788475f46 100644 --- a/webclient/app-directive.js +++ b/webclient/app-directive.js @@ -40,4 +40,19 @@ angular.module('matrixWebClient') } } }; -}]); \ No newline at end of file +}]) +.directive('elastic', [ // http://stackoverflow.com/questions/17772260/textarea-auto-height + '$timeout', + function($timeout) { + return { + restrict: 'A', + link: function($scope, element) { + var resize = function() { + return element[0].style.height = "" + element[0].scrollHeight + "px"; + }; + element.on("blur keyup change", resize); + $timeout(resize, 10); + } + }; + } +]);; |