Commit 679ada51d99bc898e6b98c077fa43880aada9688

Authored by Eric
1 parent 1bdae648a5
Exists in master

precio sugerido

Showing 1 changed file with 7 additions and 6 deletions   Show diff stats
src/js/controller.js
1 angular.module('focaModalEfectivo') 1 angular.module('focaModalEfectivo')
2 .controller('focaModalEfectivoController', 2 .controller('focaModalEfectivoController',
3 [ 3 [
4 '$scope', 4 '$scope',
5 '$uibModalInstance', 5 '$uibModalInstance',
6 'sugerido', 6 'sugerido',
7 '$timeout', 7 '$timeout',
8 function($scope, $uibModalInstance, sugerido, $timeout) { 8 function($scope, $uibModalInstance, sugerido, $timeout) {
9 if(sugerido && sugerido < 0) { 9
10 $scope.efectivo = Math.abs(sugerido); 10 $scope.efectivo = sugerido;
11 $timeout(function() { 11
12 angular.element('#importe')[0].select(); 12 $timeout(function() {
13 }); 13 angular.element('#importe')[0].select();
14 } 14 });
15
15 $scope.aceptar = function(key) { 16 $scope.aceptar = function(key) {
16 if(key === 13 && parseFloat($scope.efectivo)) { 17 if(key === 13 && parseFloat($scope.efectivo)) {
17 var efectivo = parseFloat($scope.efectivo); 18 var efectivo = parseFloat($scope.efectivo);
18 $uibModalInstance.close(efectivo); 19 $uibModalInstance.close(efectivo);
19 } 20 }
20 }; 21 };
21 22
22 $scope.cancel = function() { 23 $scope.cancel = function() {
23 $uibModalInstance.dismiss('cancel'); 24 $uibModalInstance.dismiss('cancel');
24 }; 25 };
25 } 26 }
26 ] 27 ]
27 ); 28 );
28 29