Commit abcea5a1de7918a3eb5ea527408a8a77b5dfdf66
Exists in
master
conflicts
Showing
3 changed files
Show diff stats
package.json
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | "gulp-pre-commit": "gulp pre-commit", |
| 8 | 8 | "compile": "gulp uglify", |
| 9 | 9 | "postinstall": "npm run compile && gulp clean-post-install", |
| 10 | - "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" | |
| 10 | + "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+ssh://git@git.focasoftware.com:npm/foca-directivas" | |
| 11 | 11 | }, |
| 12 | 12 | "pre-commit": [ |
| 13 | 13 | "gulp-pre-commit" |
| ... | ... | @@ -34,13 +34,13 @@ |
| 34 | 34 | "gulp-uglify": "^3.0.1", |
| 35 | 35 | "jquery": "^3.3.1", |
| 36 | 36 | "pump": "^3.0.0", |
| 37 | - "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas" | |
| 37 | + "foca-directivas": "git+ssh://git@git.focasoftware.com:npm/foca-directivas" | |
| 38 | 38 | }, |
| 39 | 39 | "devDependencies": { |
| 40 | 40 | "angular": "^1.7.5", |
| 41 | 41 | "angular-ladda": "^0.4.3", |
| 42 | 42 | "bootstrap": "^4.1.3", |
| 43 | - "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas", | |
| 43 | + "foca-directivas": "git+ssh://git@git.focasoftware.com:npm/foca-directivas", | |
| 44 | 44 | "font-awesome": "^4.7.0", |
| 45 | 45 | "gulp": "^3.9.1", |
| 46 | 46 | "gulp-angular-templatecache": "^2.2.3", |
src/js/controller.js
| 1 | 1 | angular.module('focaModalProveedor') |
| 2 | 2 | .controller('focaModalProveedorCtrl', [ |
| 3 | + '$timeout', | |
| 3 | 4 | '$filter', |
| 4 | 5 | '$scope', |
| 5 | 6 | '$uibModalInstance', |
| 6 | 7 | 'focaModalProveedorService', |
| 7 | 8 | 'transportista', |
| 8 | - function ($filter, $scope, $uibModalInstance, focaModalProveedorService, transportista) { | |
| 9 | + function ($timeout, $filter, $scope, $uibModalInstance, | |
| 10 | + focaModalProveedorService, transportista) { | |
| 9 | 11 | |
| 10 | 12 | $scope.filters = ''; |
| 11 | 13 | $scope.primerBusqueda = false; |
| ... | ... | @@ -32,19 +34,26 @@ angular.module('focaModalProveedor') |
| 32 | 34 | } |
| 33 | 35 | $scope.primerBusqueda = true; |
| 34 | 36 | $scope.proveedores = res.data; |
| 35 | - $scope.search(); | |
| 37 | + $scope.search(true); | |
| 36 | 38 | primera(); |
| 37 | 39 | $scope.searchLoading = false; |
| 38 | 40 | }); |
| 39 | 41 | } |
| 40 | 42 | }; |
| 41 | 43 | |
| 42 | - $scope.search = function () { | |
| 44 | + $scope.search = function (pressed) { | |
| 43 | 45 | if($scope.primerBusqueda) { |
| 44 | 46 | $scope.filteredProveedores = $filter('filter')( |
| 45 | 47 | $scope.proveedores, {$: $scope.filters} |
| 46 | 48 | ); |
| 47 | 49 | |
| 50 | + if(pressed && $scope.filteredProveedores.length === 0){ | |
| 51 | + $timeout(function() { | |
| 52 | + angular.element('#search')[0].focus(); | |
| 53 | + $scope.filters = ''; | |
| 54 | + }); | |
| 55 | + } | |
| 56 | + | |
| 48 | 57 | $scope.lastPage = Math.ceil( |
| 49 | 58 | $scope.filteredProveedores.length / $scope.numPerPage |
| 50 | 59 | ); |
src/views/modal-proveedor.html
| 1 | 1 | <div class="modal-header py-1"> |
| 2 | - <h5 class="modal-title" ng-hide="transportista">Búsqueda de Proveedor</h5> | |
| 3 | - <h5 class="modal-title" ng-show="transportista">Búsqueda de Transportista</h5> | |
| 2 | + <div class="row w-100"> | |
| 3 | + <div class="col-lg-6"> | |
| 4 | + <h5 class="modal-title my-1" ng-hide="transportista">Búsqueda de Proveedor</h5> | |
| 5 | + <h5 class="modal-title my-1" ng-show="transportista">Búsqueda de Transportista</h5> | |
| 6 | + </div> | |
| 7 | + <div class="input-group col-lg-6 pr-0 my-2"> | |
| 8 | + <input | |
| 9 | + ladda="searchLoading" | |
| 10 | + type="text" | |
| 11 | + class="form-control form-control-sm" | |
| 12 | + id="search" | |
| 13 | + placeholder="Busqueda" | |
| 14 | + ng-model="filters" | |
| 15 | + ng-change="search()" | |
| 16 | + ng-keydown="busquedaDown($event.keyCode)" | |
| 17 | + ng-keypress="busquedaPress($event.keyCode)" | |
| 18 | + foca-focus="selectedProveedores == -1" | |
| 19 | + ng-focus="selectedProveedores = -1" | |
| 20 | + teclado-virtual | |
| 21 | + > | |
| 22 | + <div class="input-group-append"> | |
| 23 | + <button | |
| 24 | + ladda="searchLoading" | |
| 25 | + class="btn btn-outline-secondary" | |
| 26 | + type="button" | |
| 27 | + ng-click="busquedaPress(13)"> | |
| 28 | + <i class="fa fa-search" aria-hidden="true"></i> | |
| 29 | + </button> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 4 | 33 | </div> |
| 5 | 34 | <div class="modal-body" id="modal-body"> |
| 6 | - <div class="input-group"> | |
| 7 | - <input | |
| 8 | - ladda="searchLoading" | |
| 9 | - type="text" | |
| 10 | - class="form-control form-control-sm" | |
| 11 | - placeholder="Busqueda" | |
| 12 | - ng-model="filters" | |
| 13 | - ng-change="search()" | |
| 14 | - ng-keydown="busquedaDown($event.keyCode)" | |
| 15 | - ng-keypress="busquedaPress($event.keyCode)" | |
| 16 | - foca-focus="selectedProveedores == -1" | |
| 17 | - ng-focus="selectedProveedores = -1" | |
| 18 | - teclado-virtual | |
| 19 | - > | |
| 20 | - <div class="input-group-append"> | |
| 21 | - <button | |
| 22 | - ladda="searchLoading" | |
| 23 | - class="btn btn-outline-secondary" | |
| 24 | - type="button" | |
| 25 | - ng-click="busquedaPress(13)"> | |
| 26 | - <i class="fa fa-search" aria-hidden="true"></i> | |
| 27 | - </button> | |
| 35 | + | |
| 36 | + <div ng-show="!primerBusqueda"> | |
| 37 | + Debe realizar una primer búsqueda. | |
| 28 | 38 | </div> |
| 29 | -</div> | |
| 39 | + | |
| 30 | 40 | <table ng-show="primerBusqueda" class="table table-striped table-sm"> |
| 31 | 41 | <thead> |
| 32 | 42 | <tr> |
| ... | ... | @@ -61,13 +71,16 @@ |
| 61 | 71 | foca-focus="selectedProveedores == {{key}}" |
| 62 | 72 | ng-keydown="itemProveedor($event.keyCode)" |
| 63 | 73 | > |
| 64 | - <i class="fa fa-arrow-right" aria-hidden="true"></i> | |
| 74 | + <i class="fa fa-circle-thin" aria-hidden="true"></i> | |
| 65 | 75 | </button> |
| 66 | 76 | </td> |
| 67 | 77 | </tr> |
| 68 | 78 | </tbody> |
| 69 | 79 | </table> |
| 70 | - <nav ng-show="currentPageProveedores.length > 0 && primerBusqueda"> | |
| 80 | + | |
| 81 | +</div> | |
| 82 | +<div class="modal-footer py-1"> | |
| 83 | + <nav ng-show="currentPageProveedores.length > 0 && primerBusqueda" class="mr-auto"> | |
| 71 | 84 | <ul class="pagination pagination-sm mb-0"> |
| 72 | 85 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
| 73 | 86 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> |
| ... | ... | @@ -95,7 +108,5 @@ |
| 95 | 108 | </li> |
| 96 | 109 | </ul> |
| 97 | 110 | </nav> |
| 98 | -</div> | |
| 99 | -<div class="modal-footer py-1"> | |
| 100 | 111 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
| 101 | 112 | </div> |