From 6f3f631fd11f744afa57396e8dd18e064ce90e8f Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 30 Oct 2014 13:24:40 +0000 Subject: [PATCH] SYWEB-12: More formatting. --- webclient/app-directive.js | 17 ++++++++++++++++- webclient/app.css | 6 ++++++ webclient/room/room-controller.js | 6 +++--- webclient/room/room.html | 10 +++++++--- 4 files changed, 32 insertions(+), 7 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); + } + }; + } +]);; diff --git a/webclient/app.css b/webclient/app.css index 2dc6e8caed..5ab8e2b8fd 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -443,6 +443,12 @@ textarea, input { font-family: monospace; } +.room-info-textarea-content { + height: auto; + width: 100%; + resize: vertical; +} + /*** Participant list ***/ #usersTableWrapper { diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 37f51c4e91..fcbcd75364 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -1039,9 +1039,9 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) .controller('RoomInfoController', function($scope, $modalInstance, $filter) { console.log("Displaying room info."); - $scope.submitState = function(eventType, content) { - console.log("Submitting " + eventType + " with " + content); - } + $scope.submit = function(event) { + console.error("submit >>> " + JSON.stringify(event)); + }; $scope.dismiss = $modalInstance.dismiss; diff --git a/webclient/room/room.html b/webclient/room/room.html index 65b959fe94..cc79d6b778 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -17,15 +17,19 @@