Commit 24c5a8e8a9920b2fdcee16db532fa2793ba14651
1 parent
6b3f3e7da5
Exists in
master
ok focus en modal alert
Showing
2 changed files
with
7 additions
and
3 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -4,6 +4,7 @@ angular.module('focaLogin') |
| 4 | 4 | function($scope, focaLoginService, $location, $cookies, focaModalService, md5) { |
| 5 | 5 | $scope.paso = 1; |
| 6 | 6 | $scope.enviar = function() { |
| 7 | + angular.element('#password').blur(); | |
| 7 | 8 | focaLoginService.login({ |
| 8 | 9 | idUsuario: $scope.usuario.idUsuario, |
| 9 | 10 | clave: md5.createHash($scope.usuario.clave) |
| ... | ... | @@ -25,7 +26,8 @@ angular.module('focaLogin') |
| 25 | 26 | $scope.$emit('blur'); |
| 26 | 27 | }, function(error) { |
| 27 | 28 | if (error.status === 401) { |
| 28 | - focaModalService.alert('El usuario o la contraseña han sido mal introducidos'); | |
| 29 | + focaModalService | |
| 30 | + .alert('El usuario o la contraseña han sido mal introducidos'); | |
| 29 | 31 | } |
| 30 | 32 | |
| 31 | 33 | if(error.status === -1) { |
src/views/foca-login.html
| ... | ... | @@ -8,20 +8,22 @@ |
| 8 | 8 | <input |
| 9 | 9 | type = "text" |
| 10 | 10 | ng-model = "usuario.idUsuario" |
| 11 | + ng-focus = "paso = 1" | |
| 11 | 12 | foca-focus = "paso == 1" |
| 12 | 13 | ng-keyup = "$event.keyCode == 13 && irPaso(2)" |
| 13 | - ladda="loginLoading" | |
| 14 | + ladda = "loginLoading" | |
| 14 | 15 | teclado-virtual |
| 15 | 16 | /> |
| 16 | 17 | </div> |
| 17 | 18 | <div class="login-campo"> |
| 18 | 19 | <label>Contraseña</label> |
| 19 | 20 | <input |
| 21 | + id = "password" | |
| 20 | 22 | type = "password" |
| 21 | 23 | ng-model = "usuario.clave" |
| 22 | 24 | foca-focus = "paso == 2" |
| 23 | 25 | ng-keyup = "$event.keyCode == 13 && enviar()" |
| 24 | - ladda="loginLoading" | |
| 26 | + ladda = "loginLoading" | |
| 25 | 27 | teclado-virtual |
| 26 | 28 | /> |
| 27 | 29 | </div> |