From e8f19b4c0d774bd6f1942aa4557ad0be728b9a4f Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Sep 2014 18:59:26 -0700 Subject: [PATCH] Display a 'Set Topic' button if there is no topic or it's a 0-len string. --- webclient/app.css | 10 +++++++++- webclient/room/room-controller.js | 9 ++++++++- webclient/room/room.html | 22 +++++++++++++--------- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/webclient/app.css b/webclient/app.css index 9667f3fd2..0160b4dee 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -280,7 +280,6 @@ a:active { color: #000; } color: #888; font-size: 12px; padding-right: 5px; - float: right; width: 15em; overflow: hidden; white-space: nowrap; @@ -301,6 +300,15 @@ a:active { color: #000; } width: 100%; } +.roomTopicSection { + float: right; + width: 100%; +} + +.roomTopicSetNew { + float: right; +} + .roomHeaderInfo { float: right; margin-top: 15px; diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 10ff12a96..68845df7d 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() { diff --git a/webclient/room/room.html b/webclient/room/room.html index 0fe45499e..01f0c4ee3 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -6,16 +6,20 @@
{{ room_id | mRoomName }}
-
-
- {{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}} +
+ +
+
+ {{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}} +
+
+ +
- -
- -
-