Commit a4566b19f564d3572269ffe111eaff818ca77145

Authored by Marcelo Puebla
1 parent 3d1e6dfa16
Exists in master

Corregido evento select cuando se usa el teclado virtual.

src/js/controller.js
1 1 angular.module('focaBusquedaCliente')
2 2 .controller('focaBusquedaClienteModalController', [
3 3 '$uibModalInstance', 'focaBusquedaClienteService', '$scope', '$filter',
4   - '$uibModal', 'focaModalService', '$timeout', 'vendedor', 'cobrador',
  4 + '$uibModal', 'focaModalService', '$timeout', '$rootScope', 'vendedor', 'cobrador',
5 5 function ($uibModalInstance, focaBusquedaClienteService, $scope, $filter,
6   - $uibModal, focaModalService, $timeout, vendedor, cobrador) {
  6 + $uibModal, focaModalService, $timeout, $rootScope, vendedor, cobrador) {
7 7  
8 8 $scope.cobrador = cobrador ? cobrador : {};
9 9 $scope.vendedor = vendedor ? vendedor : {};
... ... @@ -210,6 +210,23 @@ angular.module('focaBusquedaCliente')
210 210 $scope.focused = val;
211 211 };
212 212  
  213 + //Recibe aviso si el teclado está en uso
  214 + $rootScope.$on('usarTeclado', function (event, data) {
  215 + if (data) {
  216 + $scope.mostrarTeclado = true;
  217 + return;
  218 + }
  219 + $scope.mostrarTeclado = false;
  220 + });
  221 +
  222 + $scope.selectFocus = function ($event) {
  223 + // Si el teclado esta en uso no selecciona el valor
  224 + if ($scope.mostrarTeclado) {
  225 + return;
  226 + }
  227 + $event.target.select();
  228 + };
  229 +
213 230 $scope.next = function (key) {
214 231 if (key === 13) $scope.focused++;
215 232 };
src/views/foca-busqueda-cliente-modal.html
... ... @@ -166,7 +166,7 @@
166 166 ng-model="cliente.CPO"
167 167 placeholder="Ingrese CP"
168 168 ng-required="true"
169   - ng-focus="focus(3); $event.target.select();"
  169 + ng-focus="focus(3); selectFocus($event);"
170 170 foca-focus="focused == 3"
171 171 ng-keypress="next($event.keyCode)"
172 172 teclado-virtual
... ... @@ -396,7 +396,7 @@
396 396 ng-model="cliente.TEL"
397 397 ng-required="true"
398 398 ng-keypress="next($event.keyCode)"
399   - ng-focus="focus(11); $event.target.select();"
  399 + ng-focus="focus(11); selectFocus($event);"
400 400 foca-focus="focused == 11"
401 401 teclado-virtual>
402 402 </div>
... ... @@ -494,7 +494,7 @@
494 494 ng-model="cliente.cuit1"
495 495 ng-required="true"
496 496 ng-keypress="pasarCampoCuit(1)"
497   - ng-focus="focus(14); $event.target.select();"
  497 + ng-focus="focus(14); selectFocus($event);"
498 498 foca-focus="focused == 14"
499 499 teclado-virtual
500 500 foca-tipo-input
... ... @@ -508,7 +508,7 @@
508 508 ng-keypress="pasarCampoCuit(2)"
509 509 ng-model="cliente.cuit2"
510 510 ng-required="true"
511   - ng-focus="focus(15); $event.target.select();"
  511 + ng-focus="focus(15); selectFocus($event);"
512 512 foca-focus="cuitActivo == 2 || focused == 15"
513 513 teclado-virtual
514 514 foca-tipo-input
... ... @@ -522,7 +522,7 @@
522 522 ng-keypress="pasarCampoCuit(3)"
523 523 ng-model="cliente.cuit3"
524 524 ng-required="true"
525   - ng-focus="focus(16); $event.target.select();"
  525 + ng-focus="focus(16); selectValue($event)"
526 526 foca-focus="cuitActivo == 3 || focused == 16"
527 527 teclado-virtual
528 528 foca-tipo-input