Commit f54dbb212ab7bbe57a1da960136e6b1422f75b60
Exists in
master
Merge branch 'master' into 'master'
Master See merge request !5
Showing
2 changed files
Show diff stats
src/js/controller.js
... | ... | @@ -106,6 +106,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
106 | 106 | focaModalService.alert('Debe cargar al menos un articulo'); |
107 | 107 | return; |
108 | 108 | } |
109 | + $scope.saveLoading = true; | |
109 | 110 | var notaPedido = { |
110 | 111 | id: $scope.notaPedido.id, |
111 | 112 | fechaCarga: $scope.now.toISOString().slice(0, 19).replace('T', ' '), |
... | ... | @@ -156,6 +157,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
156 | 157 | $scope.notaPedido.vendedor.CodVen); |
157 | 158 | |
158 | 159 | focaModalService.alert('Nota pedido creada'); |
160 | + $scope.saveLoading = false; | |
159 | 161 | $scope.cabecera = []; |
160 | 162 | addCabecera('Moneda:', $scope.notaPedido.moneda.DETALLE); |
161 | 163 | addCabecera( |
... | ... | @@ -186,6 +188,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
186 | 188 | }, |
187 | 189 | function(error) { |
188 | 190 | focaModalService.alert('Hubo un error al crear la nota de pedido'); |
191 | + $scope.saveLoading = false; | |
189 | 192 | console.info(error); |
190 | 193 | } |
191 | 194 | ); |
src/views/nota-pedido.html
... | ... | @@ -498,6 +498,8 @@ |
498 | 498 | <div class="row align-items-end"> |
499 | 499 | <div class="col-12"> |
500 | 500 | <button |
501 | + ladda="saveLoading" | |
502 | + data-spinner-color="#FF0000" | |
501 | 503 | ng-click="crearNotaPedido()" |
502 | 504 | type="submit" |
503 | 505 | title="Crear nota pedido" |
... | ... | @@ -520,7 +522,13 @@ |
520 | 522 | <div class="row d-md-none fixed-bottom"> |
521 | 523 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> |
522 | 524 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> |
523 | - <span class="mr-3 ml-auto" ng-click="crearNotaPedido()">Guardar</span> | |
525 | + <span | |
526 | + class="mr-3 ml-auto" | |
527 | + ng-class="saveLoading ? 'text-muted' : ''" | |
528 | + ng-click="crearNotaPedido()" | |
529 | + ladda="saveLoading" | |
530 | + data-style="expand-left" | |
531 | + >Guardar</span> | |
524 | 532 | </div> |
525 | 533 | </div> |
526 | 534 | </div> |