Ensure the user add form is reset on show

This commit is contained in:
Johannes Zellner
2016-01-26 19:40:57 +01:00
parent 62d5e99802
commit fd11eb8da0
2 changed files with 13 additions and 1 deletions

View File

@@ -148,7 +148,7 @@
<div>
<div class="text-left">
<h1>Users <button class="btn btn-primary btn-outline pull-right" data-toggle="modal" data-target="#userAddModal"><i class="fa fa-user-plus"></i> New User</button></h1>
<h1>Users <button class="btn btn-primary btn-outline pull-right" ng-click="showUserAdd()"><i class="fa fa-user-plus"></i> New User</button></h1>
</div>
</div>

View File

@@ -58,6 +58,18 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
});
};
$scope.showUserAdd = function () {
$scope.useradd.error = {};
$scope.useradd.username = '';
$scope.useradd.email = '';
$scope.useradd.displayName = '';
$scope.useradd_form.$setUntouched();
$scope.useradd_form.$setPristine();
$('#userAddModal').modal('show');
};
$scope.doAdd = function () {
$scope.useradd.busy = true;