diff --git a/gulpfile.js b/gulpfile.js index 0bb4968..18e77b9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -46,7 +46,7 @@ gulp.task('uglify', ['templates'], function() { ]), concat('foca-modal-proveedor.js'), replace('src/views/', ''), - replace("['ui.bootstrap', 'focaDirectivas']", '[]'), + replace("['ui.bootstrap', 'focaDirectivas', 'angular-ladda']", '[]'), gulp.dest(paths.tmp), rename('foca-modal-proveedor.min.js'), uglify(), diff --git a/index.html b/index.html index d1953cd..6465c74 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,7 @@ + @@ -14,6 +15,9 @@ + + + diff --git a/package.json b/package.json index a7e2a1e..df25df9 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "gulp-pre-commit": "gulp pre-commit", "compile": "gulp uglify", "postinstall": "npm run compile && gulp clean-post-install", - "install-dev": "npm install angular bootstrap jquery font-awesome gulp gulp-concat gulp-jshint gulp-rename gulp-replace gulp-uglify-es gulp-clean jshint pump gulp-connect gulp-uglify jasmine-core pre-commit gulp-angular-templatecache ui-bootstrap4 gulp-htmlmin git+https://debo.suite.repo/modulos-npm/foca-directivas" + "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap jquery font-awesome gulp gulp-concat gulp-jshint gulp-rename gulp-replace gulp-uglify-es gulp-clean jshint pump gulp-connect gulp-uglify jasmine-core pre-commit gulp-angular-templatecache ui-bootstrap4 gulp-htmlmin git+https://debo.suite.repo/modulos-npm/foca-directivas" }, "pre-commit": [ "gulp-pre-commit" @@ -38,6 +38,7 @@ }, "devDependencies": { "angular": "^1.7.5", + "angular-ladda": "^0.4.3", "bootstrap": "^4.1.3", "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas", "font-awesome": "^4.7.0", @@ -51,14 +52,13 @@ "gulp-rename": "^1.4.0", "gulp-replace": "^1.0.0", "gulp-uglify": "^3.0.1", + "gulp-uglify-es": "^1.0.4", "jasmine-core": "^3.3.0", "jquery": "^3.3.1", "jshint": "^2.9.6", + "ladda": "1.0.6", "pre-commit": "^1.2.2", "pump": "^3.0.0", "ui-bootstrap4": "^3.0.5" - }, - "dependencies": { - "gulp-uglify-es": "^1.0.4" } } diff --git a/src/js/app.js b/src/js/app.js index 6c8bc63..eb3d0a6 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1 +1 @@ -angular.module('focaModalProveedor', ['ui.bootstrap', 'focaDirectivas']); +angular.module('focaModalProveedor', ['ui.bootstrap', 'focaDirectivas', 'angular-ladda']); diff --git a/src/js/controller.js b/src/js/controller.js index fb3a965..d6ec718 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -17,11 +17,12 @@ angular.module('focaModalProveedor') $scope.busquedaPress = function(key) { if (key === 13) { + $scope.searchLoading = true; var json = { razonCuitCod: $scope.filters }; focaModalProveedorService.getProveedores(json).then( - function (res) { + function(res) { for (var i = res.data.length - 1; i >= 0; i--) { if (res.data[i].COD === 0) { delete res.data[i]; @@ -31,6 +32,7 @@ angular.module('focaModalProveedor') $scope.proveedores = res.data; $scope.search(); primera(); + $scope.searchLoading = false; }); } }; diff --git a/src/views/modal-proveedor.html b/src/views/modal-proveedor.html index 9b834a6..7c114b5 100644 --- a/src/views/modal-proveedor.html +++ b/src/views/modal-proveedor.html @@ -4,6 +4,7 @@