Commit 09a9f9cc7e3235d7e9afa4f48e7be69cb732fa74

Authored by Nicolás Guarnieri
Exists in master

Merge branch 'master' into 'master'

arreglos para mejor funcionamiento en mobile

See merge request modulos-npm/foca-modal-vendedores!11
1 <html ng-app="focaModalVendedores"> 1 <html ng-app="focaModalVendedores">
2 2
3 <head> 3 <head>
4 <meta charset="UTF-8" /> 4 <meta charset="UTF-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 5 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6 6
7 <!--CSS--> 7 <!--CSS-->
8 <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" /> 8 <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
9 <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" /> 9 <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
10 <link href="node_modules/ladda/dist/ladda-themeless.min.css" rel="stylesheet"> 10 <link href="node_modules/ladda/dist/ladda-themeless.min.css" rel="stylesheet">
11 11
12 <!--VENDOR JS--> 12 <!--VENDOR JS-->
13 <script src="node_modules/jquery/dist/jquery.min.js"></script> 13 <script src="node_modules/jquery/dist/jquery.min.js"></script>
14 <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> 14 <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
15 <script src="node_modules/angular/angular.min.js"></script> 15 <script src="node_modules/angular/angular.min.js"></script>
16 <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> 16 <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script>
17 <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> 17 <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script>
18 <script src="node_modules/ladda/dist/spin.min.js"></script> 18 <script src="node_modules/ladda/dist/spin.min.js"></script>
19 <script src="node_modules/ladda/dist/ladda.min.js"></script> 19 <script src="node_modules/ladda/dist/ladda.min.js"></script>
20 <script src="node_modules/angular-ladda/dist/angular-ladda.min.js"></script> 20 <script src="node_modules/angular-ladda/dist/angular-ladda.min.js"></script>
21 21
22 <!-- BUILD --> 22 <!-- BUILD -->
23 <script src="src/js/app.js"></script> 23 <script src="src/js/app.js"></script>
24 <script src="src/js/controller.js"></script> 24 <script src="src/js/controller.js"></script>
25 <script src="src/js/service.js"></script> 25 <script src="src/js/service.js"></script>
26 26
27 <!-- /BUILD --> 27 <!-- /BUILD -->
28 28
29 <!-- CONFIG PARA DEVELOP --> 29 <!-- CONFIG PARA DEVELOP -->
30 <script type="text/javascript"> 30 <script type="text/javascript">
31 angular.module('focaModalVendedores') 31 angular.module('focaModalVendedores')
32 .controller('controller', ['$uibModal', '$timeout', function($uibModal, $timeout) { 32 .controller('controller', ['$uibModal', '$timeout', function($uibModal, $timeout) {
33 openModal(); 33 openModal();
34 34
35 function openModal() { 35 function openModal() {
36 var modalInstance = $uibModal.open( 36 var modalInstance = $uibModal.open(
37 { 37 {
38 ariaLabelledBy: 'Busqueda de Vendedores', 38 ariaLabelledBy: 'Busqueda de Vendedores',
39 templateUrl: 'src/views/modal-vendedores.html', 39 templateUrl: 'src/views/modal-vendedores.html',
40 controller: 'modalVendedoresCtrl', 40 controller: 'modalVendedoresCtrl',
41 size: 'lg' 41 size: 'lg'
42 } 42 }
43 ); 43 );
44 44
45 modalInstance.result.then( 45 modalInstance.result.then(
46 function (selectedItem) { 46 function (selectedItem) {
47 console.info(selectedItem); 47 console.info(selectedItem);
48 $timeout(openModal, 500); 48 $timeout(openModal, 500);
49 }, function () { 49 }, function () {
50 console.info('modal-component dismissed at: ' + new Date()); 50 console.info('modal-component dismissed at: ' + new Date());
51 $timeout(openModal, 500); 51 $timeout(openModal, 500);
52 } 52 }
53 ); 53 );
54 } 54 }
55 }]); 55 }]);
56 </script> 56 </script>
57 57
58 <script src="src/etc/develop.js"></script> 58 <script src="src/etc/develop.js"></script>
59 </head> 59 </head>
60 60
61 <body ng-controller="controller"> 61 <body ng-controller="controller">
62 <style>
63 .p-5 {
64 padding: 5px !important;
65 }
66 </style>
67 </body> 62 </body>
68 63
69 </html> 64 </html>
src/views/modal-vendedores.html
1 <div class="modal-header py-1"> 1 <div class="modal-header">
2 <h5 class="modal-title">Búsqueda de vendedores</h5> 2 <h5 class="modal-title my-1">Búsqueda de vendedores</h5>
3 </div> 3 </div>
4 <div class="modal-body" id="modal-body"> 4 <div class="modal-body" id="modal-body">
5 <div class="input-group"> 5 <div class="input-group">
6 <input 6 <input
7 ladda="searchLoading" 7 ladda="searchLoading"
8 type="text" 8 type="text"
9 class="form-control form-control-sm" 9 class="form-control form-control-sm"
10 placeholder="Busqueda" 10 placeholder="Busqueda"
11 ng-model="filters" 11 ng-model="filters"
12 ng-change="search()" 12 ng-change="search()"
13 ng-keydown="busquedaDown($event.keyCode)" 13 ng-keydown="busquedaDown($event.keyCode)"
14 ng-keypress="busquedaPress($event.keyCode)" 14 ng-keypress="busquedaPress($event.keyCode)"
15 foca-focus="selectedVendedor == -1" 15 foca-focus="selectedVendedor == -1"
16 ng-focus="selectedVendedor = -1" 16 ng-focus="selectedVendedor = -1"
17 > 17 >
18 <div class="input-group-append"> 18 <div class="input-group-append">
19 <button 19 <button
20 ladda="searchLoading" 20 ladda="searchLoading"
21 class="btn btn-outline-secondary" 21 class="btn btn-outline-secondary"
22 type="button" 22 type="button"
23 ng-click="busquedaPress(13)" 23 ng-click="busquedaPress(13)"
24 > 24 >
25 <i class="fa fa-search" aria-hidden="true"></i> 25 <i class="fa fa-search" aria-hidden="true"></i>
26 </button> 26 </button>
27 </div> 27 </div>
28 </div> 28 </div>
29 <table ng-show="primerBusqueda" class="table table-striped table-sm col-12"> 29 <table ng-show="primerBusqueda" class="table table-striped table-sm col-12">
30 <thead> 30 <thead>
31 <tr> 31 <tr>
32 <th>Código</th> 32 <th>Código</th>
33 <th>Nombre</th> 33 <th>Nombre</th>
34 <th></th> 34 <th></th>
35 </tr> 35 </tr>
36 </thead> 36 </thead>
37 <tbody> 37 <tbody>
38 <tr ng-show="currentPageVendedores.length == 0 && primerBusqueda"> 38 <tr ng-show="currentPageVendedores.length == 0 && primerBusqueda">
39 <td colspan="3"> 39 <td colspan="3">
40 No se encontraron resultados. 40 No se encontraron resultados.
41 </td> 41 </td>
42 </tr> 42 </tr>
43 <tr class="selected" 43 <tr class="selected"
44 ng-repeat="(key, vendedor) in currentPageVendedores" 44 ng-repeat="(key, vendedor) in currentPageVendedores"
45 ng-click="select(vendedor)" 45 ng-click="select(vendedor)"
46 > 46 >
47 <td ng-bind="vendedor.CodVen"></td> 47 <td ng-bind="vendedor.CodVen"></td>
48 <td ng-bind="vendedor.NomVen"></td> 48 <td ng-bind="vendedor.NomVen"></td>
49 <td> 49 <td class="d-md-none text-primary">
50 <i class="fa fa-arrow-right" aria-hidden="true"></i>
51 </td>
52 <td class="d-none d-md-table-cell">
50 <button 53 <button
51 type="button" 54 type="button"
52 class="btn btn-xs p-1 float-right" 55 class="btn btn-xs p-1 float-right"
53 ng-class="{ 56 ng-class="{
54 'btn-secondary': selectedVendedor != key, 57 'btn-secondary': selectedVendedor != key,
55 'btn-primary': selectedVendedor == key 58 'btn-primary': selectedVendedor == key
56 }" 59 }"
57 foca-focus="selectedVendedor == {{key}}" 60 foca-focus="selectedVendedor == {{key}}"
58 ng-keydown="itemVendedor($event.keyCode)"> 61 ng-keydown="itemVendedor($event.keyCode)">
59 <i class="fa fa-arrow-right" aria-hidden="true"></i> 62 <i class="fa fa-arrow-right" aria-hidden="true"></i>
60 </button> 63 </button>
61 </td> 64 </td>
62 </tr> 65 </tr>
63 </tbody> 66 </tbody>
64 </table> 67 </table>
65 <nav ng-show="currentPageVendedores.length > 0 && primerBusqueda"> 68 <nav ng-show="currentPageVendedores.length > 0 && primerBusqueda">
66 <ul class="pagination pagination-sm justify-content mb-0"> 69 <ul class="pagination pagination-sm justify-content mb-0">
67 <li class="page-item" ng-class="{'disabled': currentPage == 1}"> 70 <li class="page-item" ng-class="{'disabled': currentPage == 1}">
68 <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> 71 <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)">
69 <span aria-hidden="true">&laquo;</span> 72 <span aria-hidden="true">&laquo;</span>
70 <span class="sr-only">Anterior</span> 73 <span class="sr-only">Anterior</span>
71 </a> 74 </a>
72 </li> 75 </li>
73 <li 76 <li
74 class="page-item" 77 class="page-item"
75 ng-repeat="pagina in paginas" 78 ng-repeat="pagina in paginas"
76 ng-class="{'active': pagina == currentPage}" 79 ng-class="{'active': pagina == currentPage}"
77 > 80 >
78 <a 81 <a
79 class="page-link" 82 class="page-link"
80 href="#" 83 href="#"
81 ng-click="selectPage(pagina)" 84 ng-click="selectPage(pagina)"
82 ng-bind="pagina" 85 ng-bind="pagina"
83 ></a> 86 ></a>
84 </li> 87 </li>
85 <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> 88 <li class="page-item" ng-class="{'disabled': currentPage == lastPage}">
86 <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> 89 <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)">
87 <span aria-hidden="true">&raquo;</span> 90 <span aria-hidden="true">&raquo;</span>
88 <span class="sr-only">Siguiente</span> 91 <span class="sr-only">Siguiente</span>
89 </a> 92 </a>
90 </li> 93 </li>
91 </ul> 94 </ul>
92 </nav> 95 </nav>
93 </div> 96 </div>
94 <div class="modal-footer py-1"> 97 <div class="modal-footer">
95 <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> 98 <button class="btn btn-sm btn-secondary my-1" type="button" ng-click="cancel()">Cancelar</button>
96 </div> 99 </div>
97 100