Invite: reset the input when the invitation has been done

This commit is contained in:
Emmanuel ROHEE 2014-09-11 13:52:07 +02:00
parent c92740e8a9
commit 6b20fef52a
2 changed files with 6 additions and 5 deletions

View File

@ -694,12 +694,13 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
); );
}; };
$scope.inviteUser = function(user_id) { $scope.inviteUser = function() {
matrixService.invite($scope.room_id, user_id).then( matrixService.invite($scope.room_id, $scope.userIDToInvite).then(
function() { function() {
console.log("Invited."); console.log("Invited.");
$scope.feedback = "Invite sent successfully"; $scope.feedback = "Invite successfully sent to " + $scope.userIDToInvite;
$scope.userIDToInvite = "";
}, },
function(reason) { function(reason) {
$scope.feedback = "Failure: " + reason; $scope.feedback = "Failure: " + reason;

View File

@ -150,8 +150,8 @@
<div class="extraControls"> <div class="extraControls">
<span> <span>
Invite a user: Invite a user:
<input ng-model="userIDToInvite" size="32" type="text" ng-enter="inviteUser(userIDToInvite)" placeholder="User ID (ex:@user:homeserver)"/> <input ng-model="userIDToInvite" size="32" type="text" ng-enter="inviteUser()" placeholder="User ID (ex:@user:homeserver)"/>
<button ng-click="inviteUser(userIDToInvite)">Invite</button> <button ng-click="inviteUser()">Invite</button>
</span> </span>
<button ng-click="leaveRoom()">Leave</button> <button ng-click="leaveRoom()">Leave</button>
<button ng-click="startVoiceCall()" ng-show="(currentCall == undefined || currentCall.state == 'ended') && memberCount() == 2">Voice Call</button> <button ng-click="startVoiceCall()" ng-show="(currentCall == undefined || currentCall.state == 'ended') && memberCount() == 2">Voice Call</button>