mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 16:05:00 -04:00
SYWEB-12: Add ability to add new state events.
This commit is contained in:
parent
0985bfb775
commit
f618f99ece
2 changed files with 21 additions and 2 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue