Commit da61d2081882f12a10c2dc61203b4de8133bc328
1 parent
e1717de779
Exists in
master
reemplazo tipo de input por directiva
controlo que haga event target únicamente cuando el teclado esta off
Showing
2 changed files
with
19 additions
and
18 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -572,18 +572,18 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 572 | 572 | $scope.cargando = true; |
| 573 | 573 | }; |
| 574 | 574 | //Recibe aviso si el teclado está en uso |
| 575 | - // $rootScope.$on('usarTeclado', function(event, data) { | |
| 576 | - // if(data) { | |
| 577 | - // $scope.mostrarTeclado = true; | |
| 578 | - // return; | |
| 579 | - // } | |
| 580 | - // $scope.mostrarTeclado = false; | |
| 581 | - // }) | |
| 575 | + $rootScope.$on('usarTeclado', function(event, data) { | |
| 576 | + if(data) { | |
| 577 | + $scope.mostrarTeclado = true; | |
| 578 | + return; | |
| 579 | + } | |
| 580 | + $scope.mostrarTeclado = false; | |
| 581 | + }) | |
| 582 | 582 | $scope.selectFocus = function($event) { |
| 583 | - //Si el teclado esta en uso no selecciona el valor | |
| 584 | - // if($scope.mostrarTeclado) { | |
| 585 | - // return; | |
| 586 | - // } | |
| 583 | + // Si el teclado esta en uso no selecciona el valor | |
| 584 | + if($scope.mostrarTeclado) { | |
| 585 | + return; | |
| 586 | + } | |
| 587 | 587 | $event.target.select(); |
| 588 | 588 | }; |
| 589 | 589 |
src/views/nota-pedido.html
| ... | ... | @@ -133,8 +133,9 @@ |
| 133 | 133 | ng-show="articulo.editCantidad" |
| 134 | 134 | ng-model="articulo.cantidad" |
| 135 | 135 | class="form-control" |
| 136 | - type="number" | |
| 136 | + foca-tipo-input | |
| 137 | 137 | min="1" |
| 138 | + step="0.001" | |
| 138 | 139 | foca-focus="articulo.editCantidad" |
| 139 | 140 | ng-keypress="editarArticulo($event.keyCode, articulo)" |
| 140 | 141 | ng-focus="selectFocus($event)" |
| ... | ... | @@ -152,7 +153,7 @@ |
| 152 | 153 | ng-show="articulo.editPrecio" |
| 153 | 154 | ng-model="articulo.precio" |
| 154 | 155 | class="form-control" |
| 155 | - type="number" | |
| 156 | + foca-tipo-input | |
| 156 | 157 | min="0" |
| 157 | 158 | step="0.0001" |
| 158 | 159 | foca-focus="articulo.editPrecio" |
| ... | ... | @@ -211,13 +212,13 @@ |
| 211 | 212 | <td class="col text-right"> |
| 212 | 213 | <input |
| 213 | 214 | class="form-control" |
| 214 | - type="number" | |
| 215 | + foca-tipo-input | |
| 215 | 216 | min="1" |
| 217 | + step="0.001" | |
| 216 | 218 | ng-model="articuloACargar.cantidad" |
| 217 | 219 | foca-focus="!cargando" |
| 218 | 220 | esc-key="resetFilter()" |
| 219 | - ng-keypress="agregarATabla($event.keyCode)" | |
| 220 | - ng-blur="parsearATexto(articuloACargar)" | |
| 221 | + ng-keypress="agregarATabla($event.keyCode)" | |
| 221 | 222 | teclado-virtual |
| 222 | 223 | > |
| 223 | 224 | </td> |
| ... | ... | @@ -230,7 +231,7 @@ |
| 230 | 231 | > |
| 231 | 232 | <input |
| 232 | 233 | class="form-control" |
| 233 | - type="number" | |
| 234 | + foca-tipo-input | |
| 234 | 235 | min="0" |
| 235 | 236 | step="0.0001" |
| 236 | 237 | ng-model="articuloACargar.precio" |
| ... | ... | @@ -379,7 +380,7 @@ |
| 379 | 380 | <div class="col-3 px-1 m-1"> |
| 380 | 381 | <input |
| 381 | 382 | class="form-control p-1" |
| 382 | - type="number" | |
| 383 | + foca-tipo-input | |
| 383 | 384 | min="1" |
| 384 | 385 | ng-model="articuloACargar.cantidad" |
| 385 | 386 | foca-focus="!cargando" |