Commit 02446d30207419af489afde866d1207a12f49db2
Exists in
master
Merge branch 'master' into 'master'
Master See merge request !6
Showing
4 changed files
Show diff stats
gulpfile.js
... | ... | @@ -47,6 +47,7 @@ gulp.task('uglify', ['templates'], function() { |
47 | 47 | ]), |
48 | 48 | concat('foca-botonera-lateral.js'), |
49 | 49 | replace('src/views/', ''), |
50 | + replace("['angular-ladda']", '[]'), | |
50 | 51 | gulp.dest(paths.tmp), |
51 | 52 | rename('foca-botonera-lateral.min.js'), |
52 | 53 | uglify(), |
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" |