Commit 02d72d036808e505212454312be3787ad6259caf
1 parent
5708ab663a
Exists in
master
fix close modal on change path
Showing
2 changed files
with
65 additions
and
59 deletions
Show diff stats
package.json
1 | { | 1 | { |
2 | "name": "wrapper-demo", | 2 | "name": "wrapper-demo", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "", | 4 | "description": "", |
5 | "main": "main.js", | 5 | "main": "main.js", |
6 | "scripts": { | 6 | "scripts": { |
7 | "test": "unit-test.html", | 7 | "test": "unit-test.html", |
8 | "initdev": "npm install gulp --global && npm install && npm install -g jshint", | 8 | "initdev": "npm install gulp --global && npm install && npm install -g jshint", |
9 | "gulp-pre-commit": "gulp pre-commit", | 9 | "gulp-pre-commit": "gulp pre-commit", |
10 | "compile": "gulp uglify && gulp sass", | 10 | "compile": "gulp uglify && gulp sass", |
11 | "actualizar": "git pull origin master", | 11 | "actualizar": "git pull origin master", |
12 | "install-dev": "gulp pre-install && npm install && gulp post-install" | 12 | "install-dev": "gulp pre-install && npm install && gulp post-install" |
13 | }, | 13 | }, |
14 | "pre-commit": [ | 14 | "pre-commit": [ |
15 | "gulp-pre-commit" | 15 | "gulp-pre-commit" |
16 | ], | 16 | ], |
17 | "repository": { | 17 | "repository": { |
18 | "type": "git", | 18 | "type": "git", |
19 | "url": "git@debonline.dyndns.org:npm/wrapper-demo.git" | 19 | "url": "git@debonline.dyndns.org:npm/wrapper-demo.git#develop" |
20 | }, | 20 | }, |
21 | "author": "Foca Software", | 21 | "author": "Foca Software", |
22 | "license": "ISC", | 22 | "license": "ISC", |
23 | "dependencies": { | 23 | "dependencies": { |
24 | "angular": "^1.7.8", | 24 | "angular": "^1.7.8", |
25 | "angular-chart.js": "1.1.1", | 25 | "angular-chart.js": "1.1.1", |
26 | "angular-cookies": "^1.7.8", | 26 | "angular-cookies": "^1.7.8", |
27 | "angular-file-saver": "^1.1.3", | 27 | "angular-file-saver": "^1.1.3", |
28 | "angular-i18n": "^1.7.8", | 28 | "angular-i18n": "^1.7.8", |
29 | "angular-ladda": "^0.4.3", | 29 | "angular-ladda": "^0.4.3", |
30 | "angular-md5": "^0.1.10", | 30 | "angular-md5": "^0.1.10", |
31 | "angular-mocks": "^1.7.8", | 31 | "angular-mocks": "^1.7.8", |
32 | "angular-route": "^1.7.8", | 32 | "angular-route": "^1.7.8", |
33 | "angular-sanitize": "^1.7.8", | 33 | "angular-sanitize": "^1.7.8", |
34 | "angular-ui-grid": "4.6.6", | 34 | "angular-ui-grid": "4.6.6", |
35 | "angular-ui-swiper": "^2.3.8", | 35 | "angular-ui-swiper": "^2.3.8", |
36 | "bootstrap": "^4.3.1", | 36 | "bootstrap": "^4.3.1", |
37 | "chart.js": "2.7.3", | 37 | "chart.js": "2.7.3", |
38 | "excel-builder": "2.0.3", | 38 | "excel-builder": "2.0.3", |
39 | "foca-abm-chofer": "git+ssh://git@debonline.dyndns.org:npm/foca-abm-chofer.git", | 39 | "foca-abm-chofer": "git+http://git.focasoftware.com/npm/foca-abm-chofer.git#develop", |
40 | "foca-abm-plazo-pago": "git+ssh://git@debonline.dyndns.org:npm/foca-abm-plazo-pago.git", | 40 | "foca-abm-plazo-pago": "git+http://git.focasoftware.com/npm/foca-abm-plazo-pago.git#develop", |
41 | "foca-abm-precios-condiciones": "git+ssh://git@debonline.dyndns.org:npm/foca-abm-precios-condiciones.git", | 41 | "foca-abm-precios-condiciones": "git+http://git.focasoftware.com/npm/foca-abm-precios-condiciones.git#develop", |
42 | "foca-abm-vehiculo": "git+ssh://git@debonline.dyndns.org:npm/foca-abm-vehiculo.git", | 42 | "foca-abm-vehiculo": "git+http://git.focasoftware.com/npm/foca-abm-vehiculo.git#develop", |
43 | "foca-abm-vendedor-cobrador": "git+ssh://git@debonline.dyndns.org:npm/foca-abm-vendedor-cobrador.git", | 43 | "foca-abm-vendedor-cobrador": "git+http://git.focasoftware.com/npm/foca-abm-vendedor-cobrador.git#develop", |
44 | "foca-activar-hoja-ruta": "git+ssh://git@debonline.dyndns.org:npm/foca-activar-hoja-ruta.git", | 44 | "foca-activar-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-activar-hoja-ruta.git#develop", |
45 | "foca-admin-seguimiento": "git+ssh://git@debonline.dyndns.org:npm/foca-admin-seguimiento.git", | 45 | "foca-admin-seguimiento": "git+http://git.focasoftware.com/npm/foca-admin-seguimiento.git#develop", |
46 | "foca-agendar-visita": "git+ssh://git@debonline.dyndns.org:npm/foca-agendar-visita.git", | 46 | "foca-agendar-visita": "git+http://git.focasoftware.com/npm/foca-agendar-visita.git#develop", |
47 | "foca-autorizar-nota-pedido": "git+ssh://git@debonline.dyndns.org:npm/foca-autorizar-nota-pedido.git", | 47 | "foca-autorizar-nota-pedido": "git+http://git.focasoftware.com/npm/foca-autorizar-nota-pedido.git#develop", |
48 | "foca-botonera-facturador": "git+ssh://git@debonline.dyndns.org:npm/foca-botonera-facturador.git", | 48 | "foca-botonera-facturador": "git+http://git.focasoftware.com/npm/foca-botonera-facturador.git#develop", |
49 | "foca-botonera-lateral": "git+ssh://git@debonline.dyndns.org:npm/foca-botonera-lateral.git", | 49 | "foca-botonera-lateral": "git+http://git.focasoftware.com/npm/foca-botonera-lateral.git#develop", |
50 | "foca-botonera-principal": "git+ssh://git@debonline.dyndns.org:npm/foca-botonera-principal.git", | 50 | "foca-botonera-principal": "git+http://git.focasoftware.com/npm/foca-botonera-principal.git#develop", |
51 | "foca-busqueda-cliente": "git+ssh://git@debonline.dyndns.org:npm/foca-busqueda-cliente.git", | 51 | "foca-busqueda-cliente": "git+http://git.focasoftware.com/npm/foca-busqueda-cliente.git#develop", |
52 | "foca-cabecera-facturador": "git+ssh://git@debonline.dyndns.org:npm/foca-cabecera-facturador.git", | 52 | "foca-cabecera-facturador": "git+http://git.focasoftware.com/npm/foca-cabecera-facturador.git#develop", |
53 | "foca-configuracion": "git+ssh://git@debonline.dyndns.org:npm/foca-configuracion.git", | 53 | "foca-configuracion": "git+http://git.focasoftware.com/npm/foca-configuracion.git#develop", |
54 | "foca-configurar-terminal": "git+ssh://git@debonline.dyndns.org:npm/foca-configurar-terminal.git", | 54 | "foca-configurar-terminal": "git+http://git.focasoftware.com/npm/foca-configurar-terminal.git#develop", |
55 | "foca-crear-cobranza": "git+ssh://git@debonline.dyndns.org:npm/foca-crear-cobranza.git", | 55 | "foca-crear-cobranza": "git+http://git.focasoftware.com/npm/foca-crear-cobranza.git#develop", |
56 | "foca-crear-hoja-ruta": "git+ssh://git@debonline.dyndns.org:npm/foca-crear-hoja-ruta.git", | 56 | "foca-crear-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-crear-hoja-ruta.git#develop", |
57 | "foca-crear-login": "git+ssh://git@debonline.dyndns.org:npm/foca-crear-login.git", | 57 | "foca-crear-login": "git+http://git.focasoftware.com/npm/foca-crear-login.git#develop", |
58 | "foca-crear-nota-pedido": "git+ssh://git@debonline.dyndns.org:npm/foca-crear-nota-pedido.git", | 58 | "foca-crear-nota-pedido": "git+http://git.focasoftware.com/npm/foca-crear-nota-pedido.git#develop", |
59 | "foca-crear-remito": "git+ssh://git@debonline.dyndns.org:npm/foca-crear-remito.git", | 59 | "foca-crear-remito": "git+http://git.focasoftware.com/npm/foca-crear-remito.git#develop", |
60 | "foca-directivas": "git+ssh://git@debonline.dyndns.org:npm/foca-directivas.git", | 60 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git#develop", |
61 | "foca-estado-cisternas": "git+ssh://git@debonline.dyndns.org:npm/foca-estado-cisternas.git", | 61 | "foca-estado-cisternas": "git+http://git.focasoftware.com/npm/foca-estado-cisternas.git#develop", |
62 | "foca-filtros": "git+ssh://git@debonline.dyndns.org:npm/foca-filtros.git", | 62 | "foca-filtros": "git+http://git.focasoftware.com/npm/foca-filtros.git#develop", |
63 | "foca-hoja-ruta": "git+ssh://git@debonline.dyndns.org:npm/foca-hoja-ruta.git", | 63 | "foca-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-hoja-ruta.git#develop", |
64 | "foca-informes": "git+ssh://git@debonline.dyndns.org:npm/foca-informes.git", | 64 | "foca-informes": "git+http://git.focasoftware.com/npm/foca-informes.git#develop", |
65 | "foca-login": "git+ssh://git@debonline.dyndns.org:npm/foca-login.git", | 65 | "foca-login": "git+http://git.focasoftware.com/npm/foca-login.git#develop", |
66 | "foca-logistica-pedido-ruta": "git+ssh://git@debonline.dyndns.org:npm/foca-logistica-pedido-ruta.git", | 66 | "foca-logistica-pedido-ruta": "git+http://git.focasoftware.com/npm/foca-logistica-pedido-ruta.git#develop", |
67 | "foca-modal": "git+ssh://git@debonline.dyndns.org:npm/foca-modal.git", | 67 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git#develop", |
68 | "foca-modal-busqueda-productos": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-busqueda-productos.git", | 68 | "foca-modal-busqueda-productos": "git+http://git.focasoftware.com/npm/foca-modal-busqueda-productos.git#develop", |
69 | "foca-modal-cheque": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-cheque.git", | 69 | "foca-modal-cheque": "git+http://git.focasoftware.com/npm/foca-modal-cheque.git#develop", |
70 | "foca-modal-cobranza": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-cobranza.git", | 70 | "foca-modal-cobranza": "git+http://git.focasoftware.com/npm/foca-modal-cobranza.git#develop", |
71 | "foca-modal-cotizacion": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-cotizacion.git", | 71 | "foca-modal-cotizacion": "git+http://git.focasoftware.com/npm/foca-modal-cotizacion.git#develop", |
72 | "foca-modal-detalle-cisternas": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-detalle-cisternas.git", | 72 | "foca-modal-detalle-cisternas": "git+http://git.focasoftware.com/npm/foca-modal-detalle-cisternas.git#develop", |
73 | "foca-modal-detalle-hoja-ruta": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-detalle-hoja-ruta.git", | 73 | "foca-modal-detalle-hoja-ruta": "git+http://git.focasoftware.com/npm/foca-modal-detalle-hoja-ruta.git#develop", |
74 | "foca-modal-detalles": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-detalles.git", | 74 | "foca-modal-detalles": "git+http://git.focasoftware.com/npm/foca-modal-detalles.git#develop", |
75 | "foca-modal-domicilio": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-domicilio.git", | 75 | "foca-modal-domicilio": "git+http://git.focasoftware.com/npm/foca-modal-domicilio.git#develop", |
76 | "foca-modal-efectivo": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-efectivo.git", | 76 | "foca-modal-efectivo": "git+http://git.focasoftware.com/npm/foca-modal-efectivo.git#develop", |
77 | "foca-modal-factura": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-factura.git", | 77 | "foca-modal-factura": "git+http://git.focasoftware.com/npm/foca-modal-factura.git#develop", |
78 | "foca-modal-factura-detalle": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-factura-detalle.git", | 78 | "foca-modal-factura-detalle": "git+http://git.focasoftware.com/npm/foca-modal-factura-detalle.git#develop", |
79 | "foca-modal-flete": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-flete.git", | 79 | "foca-modal-flete": "git+http://git.focasoftware.com/npm/foca-modal-flete.git#develop", |
80 | "foca-modal-grafico-cisternas": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-grafico-cisternas.git", | 80 | "foca-modal-grafico-cisternas": "git+http://git.focasoftware.com/npm/foca-modal-grafico-cisternas.git#develop", |
81 | "foca-modal-informe": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-informe.git", | 81 | "foca-modal-informe": "git+http://git.focasoftware.com/npm/foca-modal-informe.git#develop", |
82 | "foca-modal-lista-precio": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-lista-precio.git", | 82 | "foca-modal-lista-precio": "git+http://git.focasoftware.com/npm/foca-modal-lista-precio.git#develop", |
83 | "foca-modal-localizar": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-localizar.git", | 83 | "foca-modal-localizar": "git+http://git.focasoftware.com/npm/foca-modal-localizar.git#develop", |
84 | "foca-modal-login": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-login.git", | 84 | "foca-modal-login": "git+http://git.focasoftware.com/npm/foca-modal-login.git#develop", |
85 | "foca-modal-nota-pedido": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-nota-pedido.git", | 85 | "foca-modal-nota-pedido": "git+http://git.focasoftware.com/npm/foca-modal-nota-pedido.git#develop", |
86 | "foca-modal-precio-condiciones": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-precio-condiciones.git", | 86 | "foca-modal-precio-condiciones": "git+http://git.focasoftware.com/npm/foca-modal-precio-condiciones.git#develop", |
87 | "foca-modal-punto-descarga": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-punto-descarga.git", | 87 | "foca-modal-punto-descarga": "git+http://git.focasoftware.com/npm/foca-modal-punto-descarga.git#develop", |
88 | "foca-modal-remito": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-remito.git", | 88 | "foca-modal-remito": "git+http://git.focasoftware.com/npm/foca-modal-remito.git#develop", |
89 | "foca-modal-resumen-cuenta": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-resumen-cuenta.git", | 89 | "foca-modal-resumen-cuenta": "git+http://git.focasoftware.com/npm/foca-modal-resumen-cuenta.git#develop", |
90 | "foca-modal-tarifa-flete": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-tarifa-flete.git", | 90 | "foca-modal-tarifa-flete": "git+http://git.focasoftware.com/npm/foca-modal-tarifa-flete.git#develop", |
91 | "foca-modal-unidad-medida": "git+ssh://git@debonline.dyndns.org:npm/foca-modal-unidad-medida.git", | 91 | "foca-modal-unidad-medida": "git+http://git.focasoftware.com/npm/foca-modal-unidad-medida.git#develop", |
92 | "foca-nombre-empresa": "git+ssh://git@debonline.dyndns.org:npm/foca-nombre-empresa.git", | 92 | "foca-nombre-empresa": "git+http://git.focasoftware.com/npm/foca-nombre-empresa.git#develop", |
93 | "foca-parametros": "git+ssh://git@debonline.dyndns.org:npm/foca-parametros.git", | 93 | "foca-parametros": "git+http://git.focasoftware.com/npm/foca-parametros.git#develop", |
94 | "foca-seguimiento": "git+ssh://git@debonline.dyndns.org:npm/foca-seguimiento.git", | 94 | "foca-seguimiento": "git+http://git.focasoftware.com/npm/foca-seguimiento.git#develop", |
95 | "foca-teclado": "git+ssh://git@debonline.dyndns.org:npm/foca-teclado.git", | 95 | "foca-teclado": "git+http://git.focasoftware.com/npm/foca-teclado.git#develop", |
96 | "font-awesome": "^4.7.0", | 96 | "font-awesome": "^4.7.0", |
97 | "gulp-angular-templatecache": "^2.2.7", | 97 | "gulp-angular-templatecache": "^2.2.7", |
98 | "gulp-htmlmin": "^5.0.1", | 98 | "gulp-htmlmin": "^5.0.1", |
99 | "gulp-sequence": "^1.0.0", | 99 | "gulp-sequence": "^1.0.0", |
100 | "gulp-uglify-es": "^1.0.4", | 100 | "gulp-uglify-es": "^1.0.4", |
101 | "jquery": "^3.4.1", | 101 | "jquery": "^3.4.1", |
102 | "jszip": "2.6.1", | 102 | "jszip": "2.6.1", |
103 | "ladda": "1.0.6", | 103 | "ladda": "1.0.6", |
104 | "leaflet": "1.3.4", | 104 | "leaflet": "1.3.4", |
105 | "lodash": "4.17.11", | 105 | "lodash": "4.17.11", |
106 | "moment": "2.23.0", | 106 | "moment": "2.23.0", |
107 | "ngstorage": "^0.3.11", | 107 | "ngstorage": "^0.3.11", |
108 | "node-sass": "^4.12.0", | 108 | "node-sass": "^4.12.0", |
109 | "pdfmake": "0.1.41", | 109 | "pdfmake": "0.1.41", |
110 | "popper.js": "^1.15.0", | 110 | "popper.js": "^1.15.0", |
111 | "uglify": "^0.1.5", | 111 | "uglify": "^0.1.5", |
112 | "ui-bootstrap4": "^3.0.6" | 112 | "ui-bootstrap4": "^3.0.6" |
113 | }, | 113 | }, |
114 | "devDependencies": { | 114 | "devDependencies": { |
115 | "gulp": "3.9.1", | 115 | "gulp": "3.9.1", |
116 | "gulp-clean": "^0.4.0", | 116 | "gulp-clean": "^0.4.0", |
117 | "gulp-concat": "^2.6.1", | 117 | "gulp-concat": "^2.6.1", |
118 | "gulp-connect": "^5.7.0", | 118 | "gulp-connect": "^5.7.0", |
119 | "gulp-jshint": "^2.1.0", | 119 | "gulp-jshint": "^2.1.0", |
120 | "gulp-rename": "^1.4.0", | 120 | "gulp-rename": "^1.4.0", |
121 | "gulp-replace": "^1.0.0", | 121 | "gulp-replace": "^1.0.0", |
122 | "gulp-sass": "^4.0.1", | 122 | "gulp-sass": "^4.0.1", |
123 | "gulp-uglify": "^3.0.2", | 123 | "gulp-uglify": "^3.0.2", |
124 | "gulp-watch": "^5.0.1", | 124 | "gulp-watch": "^5.0.1", |
125 | "jasmine-core": "^3.4.0", | 125 | "jasmine-core": "^3.4.0", |
126 | "jshint": "^2.10.2", | 126 | "jshint": "^2.10.2", |
127 | "pre-commit": "^1.2.2", | 127 | "pre-commit": "^1.2.2", |
128 | "pump": "^3.0.0" | 128 | "pump": "^3.0.0" |
129 | } | 129 | } |
130 | } | 130 | } |
131 | 131 |
src/js/controller.js
1 | angular.module('appWrapperDemo') | 1 | angular.module('appWrapperDemo') |
2 | .controller('appWrapperDemoController', [ | 2 | .controller('appWrapperDemoController', [ |
3 | '$scope', | 3 | '$scope', |
4 | '$rootScope', | 4 | '$rootScope', |
5 | '$timeout', | 5 | '$timeout', |
6 | function($scope, $rootScope, $timeout) { | 6 | '$uibModalStack', |
7 | function($scope, $rootScope, $timeout, $uibModalStack) { | ||
7 | $scope.usarTeclado = false; | 8 | $scope.usarTeclado = false; |
8 | $rootScope.$broadcast('usarTeclado', false); | 9 | $rootScope.$broadcast('usarTeclado', false); |
9 | $scope.mostrarTeclado = false; | 10 | $scope.mostrarTeclado = false; |
10 | //Envía broadcast para avisar que el teclado está en funcionamiento o no | 11 | //Envía broadcast para avisar que el teclado está en funcionamiento o no |
11 | //para su uso cambiar ng-click del boton por esta función | 12 | //para su uso cambiar ng-click del boton por esta función |
12 | $scope.cambioUsoTeclado = function() { | 13 | $scope.cambioUsoTeclado = function() { |
13 | if($scope.usarTeclado) { | 14 | if($scope.usarTeclado) { |
14 | $scope.usarTeclado = false; | 15 | $scope.usarTeclado = false; |
15 | $rootScope.$broadcast('usarTeclado', false); | 16 | $rootScope.$broadcast('usarTeclado', false); |
16 | return; | 17 | return; |
17 | } | 18 | } |
18 | $scope.usarTeclado = true; | 19 | $scope.usarTeclado = true; |
19 | $rootScope.$broadcast('usarTeclado', true); | 20 | $rootScope.$broadcast('usarTeclado', true); |
20 | }; | 21 | }; |
21 | 22 | ||
22 | $rootScope.$on('focus', function() { | 23 | $rootScope.$on('focus', function() { |
23 | if(!$scope.usarTeclado) { | 24 | if(!$scope.usarTeclado) { |
24 | return; | 25 | return; |
25 | } | 26 | } |
26 | $scope.mostrarTeclado = true; | 27 | $scope.mostrarTeclado = true; |
27 | $timeout.cancel($scope.timeout); | 28 | $timeout.cancel($scope.timeout); |
28 | if(!$scope.$$phase) { | 29 | if(!$scope.$$phase) { |
29 | $scope.$apply(); | 30 | $scope.$apply(); |
30 | } | 31 | } |
31 | }); | 32 | }); |
32 | $rootScope.$on('blur', function() { | 33 | $rootScope.$on('blur', function() { |
33 | $scope.timeout = $timeout(function() { | 34 | $scope.timeout = $timeout(function() { |
34 | $scope.mostrarTeclado = false; | 35 | $scope.mostrarTeclado = false; |
35 | if(!$scope.$$phase) { | 36 | if(!$scope.$$phase) { |
36 | $scope.$apply(); | 37 | $scope.$apply(); |
37 | } | 38 | } |
38 | }, 150); | 39 | }, 150); |
39 | }); | 40 | }); |
41 | |||
42 | // Close all modals | ||
43 | $rootScope.$on('$locationChangeSuccess', function() { | ||
44 | $uibModalStack.dismissAll('close'); | ||
45 | }); | ||
40 | } | 46 | } |
41 | ]); | 47 | ]); |
42 | 48 |