mirror of
https://github.com/Foltik/Shimapan
synced 2025-01-07 08:42:49 -05:00
Update button shake for registering
This commit is contained in:
parent
695696965c
commit
d3de95c5dc
@ -11,7 +11,7 @@ angular.module('LoginComp', ['AuthSvc']).component('loginComponent', {
|
|||||||
$scope.error = true;
|
$scope.error = true;
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$scope.error = false;
|
$scope.error = false;
|
||||||
},820);
|
}, 820);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}]
|
}]
|
||||||
|
@ -2,12 +2,17 @@ var angular = require('angular');
|
|||||||
|
|
||||||
angular.module('RegisterComp', ['AuthSvc']).component('registerComponent', {
|
angular.module('RegisterComp', ['AuthSvc']).component('registerComponent', {
|
||||||
templateUrl: '/views/shimapan/register-form.html',
|
templateUrl: '/views/shimapan/register-form.html',
|
||||||
controller: ['$scope', 'AuthService', function ($scope, AuthService) {
|
controller: ['$scope', '$timeout', 'AuthService', function ($scope, $timeout, AuthService) {
|
||||||
$scope.register = function () {
|
$scope.register = function () {
|
||||||
AuthService.register({
|
AuthService.register({
|
||||||
username: $scope.username,
|
username: $scope.username,
|
||||||
password: $scope.password,
|
password: $scope.password,
|
||||||
invite: $scope.invite
|
invite: $scope.invite
|
||||||
|
}).catch(function() {
|
||||||
|
$scope.error = true;
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.error = false
|
||||||
|
}, 820);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}]
|
}]
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<form ng-submit="login()">
|
<form ng-submit="login()">
|
||||||
<input id="username" placeholder="Username" class="form-control" type="text" ng-model="username"/>
|
<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="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>
|
</form>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
@ -5,7 +5,7 @@
|
|||||||
<input id="username" placeholder="Username" class="form-control" type="text" ng-model="username"/>
|
<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="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"/>
|
<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>
|
</form>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue
Block a user