summary refs log tree commit diff
path: root/webclient/room
diff options
context:
space:
mode:
Diffstat (limited to 'webclient/room')
-rw-r--r--webclient/room/room-controller.js11
-rw-r--r--webclient/room/room.html4
2 files changed, 12 insertions, 3 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index fcbcd75364..ce513990f2 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -1018,6 +1018,13 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
     };
 
     $scope.openRoomInfo = function() {
+        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));
         var modalInstance = $modal.open({
             templateUrl: 'roomInfoTemplate.html',
             controller: 'RoomInfoController',
@@ -1040,7 +1047,9 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
     console.log("Displaying room info.");
 
     $scope.submit = function(event) {
-        console.error("submit >>> " + JSON.stringify(event));
+        if (event.content) {
+            console.error("submit >>> " + JSON.stringify(event));
+        }
     };
 
     $scope.dismiss = $modalInstance.dismiss;
diff --git a/webclient/room/room.html b/webclient/room/room.html
index cc79d6b778..627918223a 100644
--- a/webclient/room/room.html
+++ b/webclient/room/room.html
@@ -16,7 +16,7 @@
     <script type="text/ng-template" id="roomInfoTemplate.html">
         <div class="modal-body">
             <table class="room-info">
-            <tr ng-repeat="(key, event) in events.rooms[room_id] | stateEventsFilter" class="room-info-event">
+            <tr ng-repeat="(key, event) in roomInfoStateEvents" class="room-info-event">
                 <td class="room-info-event-meta" width="30%">
                     <span class="monospace">{{ key }}</span>
                     <br/>
@@ -29,7 +29,7 @@
                     </button>
                 </td>
                 <td class="room-info-event-content" width="70%">
-                    <textarea class="room-info-textarea-content" elastic ng-model="event.content | json"></textarea> 
+                    <textarea class="room-info-textarea-content" msd-elastic ng-model="event.content" asjson></textarea> 
                 </td>
             </tr>
             </table>