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:40:34 -0700
committerKegan Dougal <kegan@matrix.org>2014-09-08 18:40:34 -0700
commit6bdb23449a7b4f5ca0426ec6c942332b245eec30 (patch)
tree223c9c950c8dd91b288315df50023a79ddbeac4c /webclient/room/room-controller.js
parentFixed bug which displayed an older room topic because it was being returned f... (diff)
downloadsynapse-6bdb23449a7b4f5ca0426ec6c942332b245eec30.tar.xz
Add ability to set topic by double-clicking on the topic text then hitting enter.
Diffstat (limited to 'webclient/room/room-controller.js')
-rw-r--r--webclient/room/room-controller.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js
index c8ca771b25..10ff12a96b 100644
--- a/webclient/room/room-controller.js
+++ b/webclient/room/room-controller.js
@@ -42,6 +42,31 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
     $scope.imageURLToSend = "";
     $scope.userIDToInvite = "";
     
+    // vars and functions for updating the topic
+    $scope.topic = {
+        isEditing: false,
+        newTopicText: "",
+        editTopic: function() {
+            if ($scope.topic.isEditing) {
+                console.log("Warning: Already editing topic.");
+                return;
+            }
+            $scope.topic.newTopicText = $rootScope.events.rooms[$scope.room_id]['m.room.topic'].content.topic;
+            $scope.topic.isEditing = true;
+        },
+        updateTopic: function() {
+            console.log("Updating topic to "+$scope.topic.newTopicText);
+            matrixService.setTopic($scope.room_id, $scope.topic.newTopicText);
+            $scope.topic.isEditing = false;
+        },
+        cancelEdit: function() {
+            $scope.topic.isEditing = false;
+        }
+    };
+    
+    
+    
+    
     var scrollToBottom = function(force) {
         console.log("Scrolling to bottom");