diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index ce513990f2bb33f0ba57ca7e7d38d5a94891e05c..df93ccf5b88d2875c5b690f7077d8951355e17a7 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -1043,12 +1043,19 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) $modalInstance.close("redact"); }; }) -.controller('RoomInfoController', function($scope, $modalInstance, $filter) { +.controller('RoomInfoController', function($scope, $modalInstance, $filter, matrixService) { console.log("Displaying room info."); $scope.submit = function(event) { if (event.content) { - console.error("submit >>> " + JSON.stringify(event)); + console.log("submit >>> " + JSON.stringify(event.content)); + matrixService.sendStateEvent($scope.room_id, event.type, + event.content, event.state_key).then(function(response) { + $modalInstance.dismiss(); + }, function(err) { + $scope.feedback = err.data.error; + } + ); } }; diff --git a/webclient/room/room.html b/webclient/room/room.html index 627918223a9f9bae4fa3e334d82a5f0843eaf8fa..16c35c032c2703d4131e9c2ff271c6b2b737e570 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -24,7 +24,7 @@ <br/> Set by: <span class="monospace">{{ event.user_id }}</span> <br/> - <button ng-click="submit(event)" type="button" class="btn btn-success"> + <button ng-click="submit(event)" type="button" class="btn btn-success" ng-disabled="!event.content"> Submit </button> </td>