summary refs log tree commit diff
path: root/webclient/room/room-controller.js
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-08 18:59:26 -0700
committerKegan Dougal <kegan@matrix.org>2014-09-08 18:59:26 -0700
commite8f19b4c0d774bd6f1942aa4557ad0be728b9a4f (patch)
treed3246c5a47be733cdbf294065a909bdeaf4a9f36 /webclient/room/room-controller.js
parentAdd ability to set topic by double-clicking on the topic text then hitting en... (diff)
downloadsynapse-e8f19b4c0d774bd6f1942aa4557ad0be728b9a4f.tar.xz
Display a 'Set Topic' button if there is no topic or it's a 0-len string.
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 10ff12a96b..68845df7d1 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -51,7 +51,14 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
                 console.log("Warning: Already editing topic.");
                 return;
             }
-            $scope.topic.newTopicText = $rootScope.events.rooms[$scope.room_id]['m.room.topic'].content.topic;
+            var topicEvent = $rootScope.events.rooms[$scope.room_id]['m.room.topic'];
+            if (topicEvent) {
+                $scope.topic.newTopicText = topicEvent.content.topic;
+            }
+            else {
+                $scope.topic.newTopicText = "";
+            }
+            
             $scope.topic.isEditing = true;
         },
         updateTopic: function() {