Skip to content
Snippets Groups Projects
Commit 7b8e24a5 authored by Matthew Hodgson's avatar Matthew Hodgson
Browse files

close buttons on recents (SYWEB-68)

parent 53841642
No related branches found
No related tags found
No related merge requests found
...@@ -67,6 +67,16 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even ...@@ -67,6 +67,16 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
} }
}; };
$scope.leave = function(room_id) {
matrixService.leave(room_id).then(
function(response) {
console.log("Left room " + room_id);
},
function(error) {
console.log("Failed to leave room " + room_id + ": " + error.data.error);
});
};
// Logs the user out // Logs the user out
$scope.logout = function() { $scope.logout = function() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<table class="recentsTable"> <table class="recentsTable">
<tbody ng-repeat="(index, room) in events.rooms | orderRecents" <tbody ng-repeat="(index, room) in events.rooms | orderRecents"
ng-click="goToPage('room/' + (room.room_alias ? room.room_alias : room.room_id) )" ng-click="goToPage('room/' + (room.room_alias ? room.room_alias : room.room_id) )"
class ="recentsRoom" class="recentsRoom"
ng-class="{'recentsRoomSelected': (room.room_id === recentsSelectedRoomID)}"> ng-class="{'recentsRoomSelected': (room.room_id === recentsSelectedRoomID)}">
<tr> <tr>
<td ng-class="room['m.room.join_rules'].content.join_rule == 'public' ? 'recentsRoomName recentsPublicRoom' : 'recentsRoomName'"> <td ng-class="room['m.room.join_rules'].content.join_rule == 'public' ? 'recentsRoomName recentsPublicRoom' : 'recentsRoomName'">
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
{{ lastMsg = eventHandlerService.getLastMessage(room.room_id, true);"" }} {{ lastMsg = eventHandlerService.getLastMessage(room.room_id, true);"" }}
{{ (lastMsg.ts) | date:'MMM d HH:mm' }} {{ (lastMsg.ts) | date:'MMM d HH:mm' }}
<img ng-click="leave(room.room_id); $event.stopPropagation();" src="img/close.png" width="10" height="10" style="margin-bottom: -1px; margin-left: 2px;" alt="close"/>
</td> </td>
</tr> </tr>
......
...@@ -829,7 +829,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) ...@@ -829,7 +829,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
matrixService.leave($scope.room_id).then( matrixService.leave($scope.room_id).then(
function(response) { function(response) {
console.log("Left room "); console.log("Left room " + $scope.room_id);
$location.url("home"); $location.url("home");
}, },
function(error) { function(error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment