diff options
Diffstat (limited to 'webclient')
-rw-r--r-- | webclient/app-controller.js | 10 | ||||
-rw-r--r-- | webclient/recents/recents.html | 4 | ||||
-rw-r--r-- | webclient/room/room-controller.js | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/webclient/app-controller.js b/webclient/app-controller.js index 0e823b43e7..7d61207554 100644 --- a/webclient/app-controller.js +++ b/webclient/app-controller.js @@ -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 $scope.logout = function() { diff --git a/webclient/recents/recents.html b/webclient/recents/recents.html index edfc1677eb..ff811b2b8d 100644 --- a/webclient/recents/recents.html +++ b/webclient/recents/recents.html @@ -2,7 +2,7 @@ <table class="recentsTable"> <tbody ng-repeat="(index, room) in events.rooms | orderRecents" ng-click="goToPage('room/' + (room.room_alias ? room.room_alias : room.room_id) )" - class ="recentsRoom" + class="recentsRoom" ng-class="{'recentsRoomSelected': (room.room_id === recentsSelectedRoomID)}"> <tr> <td ng-class="room['m.room.join_rules'].content.join_rule == 'public' ? 'recentsRoomName recentsPublicRoom' : 'recentsRoomName'"> @@ -19,6 +19,8 @@ {{ lastMsg = eventHandlerService.getLastMessage(room.room_id, true);"" }} {{ (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> </tr> diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index ff0f1e05fa..384d7dc9a6 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -829,7 +829,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) matrixService.leave($scope.room_id).then( function(response) { - console.log("Left room "); + console.log("Left room " + $scope.room_id); $location.url("home"); }, function(error) { |