1
0
mirror of https://github.com/Foltik/Shimapan synced 2025-01-05 15:58:03 -05:00

Update button shake for registering

This commit is contained in:
Jack Foltz 2018-01-15 10:10:01 -05:00
parent 695696965c
commit d3de95c5dc
Signed by: foltik
GPG Key ID: 303F88F996E95541
4 changed files with 9 additions and 4 deletions

View File

@ -11,7 +11,7 @@ angular.module('LoginComp', ['AuthSvc']).component('loginComponent', {
$scope.error = true;
$timeout(function() {
$scope.error = false;
},820);
}, 820);
});
};
}]

View File

@ -2,12 +2,17 @@ var angular = require('angular');
angular.module('RegisterComp', ['AuthSvc']).component('registerComponent', {
templateUrl: '/views/shimapan/register-form.html',
controller: ['$scope', 'AuthService', function ($scope, AuthService) {
controller: ['$scope', '$timeout', 'AuthService', function ($scope, $timeout, AuthService) {
$scope.register = function () {
AuthService.register({
username: $scope.username,
password: $scope.password,
invite: $scope.invite
}).catch(function() {
$scope.error = true;
$timeout(function() {
$scope.error = false
}, 820);
});
};
}]

View File

@ -4,7 +4,7 @@
<form ng-submit="login()">
<input id="username" placeholder="Username" class="form-control" type="text" ng-model="username"/>
<input id="password" placeholder="Password" class="form-control" type="password" ng-model="password"/>
<button type="submit" class="btn" ng-class="{shake: error, noshake: !error}">Submit</button>
<button type="submit" class="btn" ng-class="{shake: error}">Submit</button>
</form>
</fieldset>
</div>

View File

@ -5,7 +5,7 @@
<input id="username" placeholder="Username" class="form-control" type="text" ng-model="username"/>
<input id="password" placeholder="Password" class="form-control" type="password" ng-model="password"/>
<input id="invite" placeholder="Invite Code" class="form-control" type="text" ng-model="invite"/>
<button type="submit" class="btn">Submit</button>
<button type="submit" class="btn" ng-class="{shake: error}">Submit</button>
</form>
</fieldset>
</div>