Commit 961b04a1507fa1541a05c9f676423ecc4b9a5b61
1 parent
68dae49874
Exists in
master
Guardar imagenes
Showing
2 changed files
with
12 additions
and
4 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -11,8 +11,14 @@ angular.module('focaModalDetalles') |
11 | 11 | |
12 | 12 | $scope.mobile = APP === 'cobranza'; |
13 | 13 | $scope.detalles = parametros; |
14 | + $scope.newFiles = { | |
15 | + files: [] | |
16 | + }; | |
14 | 17 | |
15 | - $scope.$watch('detalles.files', function() { | |
18 | + $scope.$watch('newFiles.files', function() { | |
19 | + $scope.newFiles.files.forEach(function(file) { | |
20 | + $scope.detalles.files.push(file); | |
21 | + }); | |
16 | 22 | validarExtSize(); |
17 | 23 | }); |
18 | 24 | |
... | ... | @@ -25,11 +31,13 @@ angular.module('focaModalDetalles') |
25 | 31 | }; |
26 | 32 | |
27 | 33 | $scope.aceptar = function() { |
28 | - | |
29 | 34 | $scope.detalles.importe = parseFloat($scope.detalles.importe); |
30 | 35 | $uibModalInstance.close($scope.detalles); |
31 | 36 | }; |
32 | 37 | |
38 | + $scope.cambioFoto = function(data) { | |
39 | + $scope.detalles.files.push(data.files); | |
40 | + }; | |
33 | 41 | $scope.seleccionarFoto = function() { |
34 | 42 | var srcType = Camera.PictureSourceType.SAVEDPHOTOALBUM; |
35 | 43 | var options = setOptions(srcType); |
... | ... | @@ -82,7 +90,7 @@ angular.module('focaModalDetalles') |
82 | 90 | totalSize += file.size / 1000000; |
83 | 91 | var fileExt = file.name.split('.').pop(); |
84 | 92 | |
85 | - if(fileExt != 'jpg' && fileExt != 'png') { | |
93 | + if(fileExt !== 'jpg' && fileExt !== 'png') { | |
86 | 94 | invalidExt = true; |
87 | 95 | } |
88 | 96 | }); |
src/views/modal-detalles.html