Skip to content
Snippets Groups Projects
Commit 0985bfb7 authored by Kegan Dougal's avatar Kegan Dougal
Browse files

SYWEB-12: Allow edited state events to be submitted.

parent 9de9661b
No related branches found
No related tags found
No related merge requests found
...@@ -1043,12 +1043,19 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) ...@@ -1043,12 +1043,19 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
$modalInstance.close("redact"); $modalInstance.close("redact");
}; };
}) })
.controller('RoomInfoController', function($scope, $modalInstance, $filter) { .controller('RoomInfoController', function($scope, $modalInstance, $filter, matrixService) {
console.log("Displaying room info."); console.log("Displaying room info.");
$scope.submit = function(event) { $scope.submit = function(event) {
if (event.content) { 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;
}
);
} }
}; };
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<br/> <br/>
Set by: <span class="monospace">{{ event.user_id }}</span> Set by: <span class="monospace">{{ event.user_id }}</span>
<br/> <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 Submit
</button> </button>
</td> </td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment