summary refs log tree commit diff
path: root/webclient/room/room-controller.js
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-10-30 17:01:17 +0000
committerKegan Dougal <kegan@matrix.org>2014-10-30 17:01:17 +0000
commitf618f99ecea1c200b10e11de7b6fc64fcd1b7e78 (patch)
treeb5db8e1d970eff7716dca92dcce733c0f0be08a4 /webclient/room/room-controller.js
parentSYWEB-12: Allow edited state events to be submitted. (diff)
downloadsynapse-f618f99ecea1c200b10e11de7b6fc64fcd1b7e78.tar.xz
SYWEB-12: Add ability to add new state events.
Diffstat (limited to 'webclient/room/room-controller.js')
-rw-r--r--webclient/room/room-controller.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index df93ccf5b8..59274baccb 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -1018,13 +1018,20 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
     };
 
     $scope.openRoomInfo = function() {
+        $scope.roomInfo = {};
+        $scope.roomInfo.newEvent = {
+            content: {},
+            type: "",
+            state_key: ""
+        };
+
         var stateFilter = $filter("stateEventsFilter");
         var stateEvents = stateFilter($scope.events.rooms[$scope.room_id]);
         // The modal dialog will 2-way bind this field, so we MUST make a deep
         // copy of the state events else we will be *actually adjusing our view
         // of the world* when fiddling with the JSON!! Apparently parse/stringify
         // is faster than jQuery's extend when doing deep copies.
-        $scope.roomInfoStateEvents = JSON.parse(JSON.stringify(stateEvents));
+        $scope.roomInfo.stateEvents = JSON.parse(JSON.stringify(stateEvents));
         var modalInstance = $modal.open({
             templateUrl: 'roomInfoTemplate.html',
             controller: 'RoomInfoController',