Commit 957cd74950b902d93468ecaeed5ae568fa1b6386

Authored by Pablo Marco del Pont
Exists in master

Merge branch 'master' into 'master'

Master(efernandez)

See merge request modulos-npm/foca-modal-busqueda-productos!12
... ... @@ -39,7 +39,7 @@
39 39 templateUrl: 'src/views/modal-busqueda-productos.html',
40 40 controller: 'modalBusquedaProductosCtrl',
41 41 size: 'lg',
42   - resolve: {idLista : function() { return null; }}
  42 + resolve: {idLista : function() { return -1; }}
43 43 }
44 44 );
45 45  
src/js/controller.js
... ... @@ -21,19 +21,20 @@ angular.module('focaBusquedaProductos')
21 21 //METODOS
22 22 $scope.busquedaPress = function(key) {
23 23 if (key === 13) {
24   - $scope.primerBusqueda = true;
25   - if(idLista) {
  24 + if(idLista > 0) {
26 25 focaBusquedaProductosService
27 26 .getProductosByIdLista(idLista, $scope.filters)
28 27 .then(
29 28 function(res) {
  29 + $scope.primerBusqueda = true;
30 30 $scope.productos = res.data;
31 31 $scope.search();
32 32 }
33 33 );
34   - } else {
  34 + } else if(idLista === -1) {
35 35 focaBusquedaProductosService.getProductos().then(
36 36 function(res) {
  37 + $scope.primerBusqueda = true;
37 38 $scope.productos = res.data;
38 39 $scope.search();
39 40 primera();
src/views/modal-busqueda-productos.html
... ... @@ -31,7 +31,7 @@
31 31 </tr>
32 32 </thead>
33 33 <tbody>
34   - <tr ng-show="currentPageProductos.length == 0">
  34 + <tr ng-show="currentPageProductos.length == 0 && primerBusqueda">
35 35 <td colspan="5">
36 36 No se encontraron resultados.
37 37 </td>