Commit 04074190765bf88afad347e0f954d5203a203843
1 parent
cd82850dff
Exists in
master
and in
1 other branch
boton guardar con ladda y verde al guardar
Showing
3 changed files
with
27 additions
and
9 deletions
Show diff stats
src/js/app.js
src/js/service.js
| ... | ... | @@ -6,6 +6,7 @@ angular.module('focaBotoneraLateral') |
| 6 | 6 | cancelar: false, |
| 7 | 7 | pausar: false, |
| 8 | 8 | guardar: false, |
| 9 | + guardando: false, | |
| 9 | 10 | funcionGuardar: undefined, |
| 10 | 11 | pathCancelar: undefined, |
| 11 | 12 | custom: [] |
| ... | ... | @@ -35,4 +36,12 @@ angular.module('focaBotoneraLateral') |
| 35 | 36 | funcion: funcion |
| 36 | 37 | }); |
| 37 | 38 | }; |
| 39 | + this.startGuardar = function() { | |
| 40 | + this.botones.guardando = true; | |
| 41 | + | |
| 42 | + }; | |
| 43 | + this.endGuardar = function(guardado) { | |
| 44 | + this.botones.guardando = false; | |
| 45 | + if(guardado) angular.element('#guardar').addClass('guardado'); | |
| 46 | + }; | |
| 38 | 47 | }); |
src/views/botonera-lateral.html
| ... | ... | @@ -4,14 +4,23 @@ |
| 4 | 4 | <div class="px-2 mt-auto"> |
| 5 | 5 | <div class="container"> |
| 6 | 6 | <div class="row"> |
| 7 | - <button | |
| 8 | - ng-click="botones.funcionGuardar()" | |
| 9 | - ng-show="botones.guardar" | |
| 10 | - type="button" | |
| 11 | - title="Guardar" | |
| 12 | - class="btn btn-block border border-dark"> | |
| 13 | - <strong>GUARDAR</strong> | |
| 14 | - </button> | |
| 7 | + <div | |
| 8 | + ladda="botones.guardando" | |
| 9 | + data-spinner-size="30" | |
| 10 | + data-spinner-color="#000000" | |
| 11 | + class="mb-2 border border-dark rounded" | |
| 12 | + > | |
| 13 | + <button | |
| 14 | + id="guardar" | |
| 15 | + ng-click="botones.funcionGuardar()" | |
| 16 | + ng-show="botones.guardar" | |
| 17 | + ng-disabled="botones.guardando" | |
| 18 | + type="button" | |
| 19 | + title="Guardar" | |
| 20 | + class="btn btn-block"> | |
| 21 | + <strong>GUARDAR</strong> | |
| 22 | + </button> | |
| 23 | + </div> | |
| 15 | 24 | <button |
| 16 | 25 | ng-show="botones.pausar" |
| 17 | 26 | type="button" |