Add ability to set topic by double-clicking on the topic text then hitting enter.

This commit is contained in:
Kegan Dougal 2014-09-08 18:40:34 -07:00
parent f64cc237fc
commit 6bdb23449a
5 changed files with 59 additions and 1 deletions

View file

@ -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");