Commit 90e72dbbc296030030118d8bc4feda413c25c0a6
1 parent
18045edafd
Exists in
develop
agrego spinner a modal promociones
Showing
2 changed files
with
12 additions
and
7 deletions
Show diff stats
src/app/shared/promocion/promocion.component.html
| 1 | -<!-- <div class="d-flex justify-content-center" | |
| 2 | - *ngIf="loading"> | |
| 3 | - <div class="spinner-border text-primary" role="status"> | |
| 4 | - <span class="sr-only">Loading...</span> | |
| 5 | - </div> | |
| 6 | -</div> --> | |
| 7 | 1 | <div class="bg-primary rounded"> |
| 8 | 2 | <div class="modal-header" *ngIf="articulosPromo.length"> |
| 9 | 3 | <img |
| ... | ... | @@ -36,7 +30,7 @@ |
| 36 | 30 | </div> |
| 37 | 31 | </div> |
| 38 | 32 | </div> |
| 39 | - <div class="modal-body" *ngIf="articulosPromo.length"> | |
| 33 | + <div class="modal-body"> | |
| 40 | 34 | <div class="row no-gutters w-100"> |
| 41 | 35 | <div class="col-9 col-9 align-self-center"> |
| 42 | 36 | <p class="text-white"><small>¿TE GUSTARÍA LLEVAR ESTE ARTÍCULO</small></p> |
| ... | ... | @@ -53,6 +47,14 @@ |
| 53 | 47 | </div> |
| 54 | 48 | </div> |
| 55 | 49 | <div |
| 50 | + class="d-flex justify-content-center mt-2" | |
| 51 | + *ngIf="loading"> | |
| 52 | + <div class="spinner-border text-white" role="status"> | |
| 53 | + <span class="sr-only">Loading...</span> | |
| 54 | + </div> | |
| 55 | + </div> | |
| 56 | + <div | |
| 57 | + *ngIf="articulosPromo.length" | |
| 56 | 58 | class="row mt-3 no-gutters lista-promociones scroll-y-visible" |
| 57 | 59 | (scroll)="scrollEvent($event)"> |
| 58 | 60 | <div class="col-12"> |
src/app/shared/promocion/promocion.component.ts
| ... | ... | @@ -21,6 +21,7 @@ export class PromocionComponent implements OnInit { |
| 21 | 21 | promociones: IArticulo[] = []; |
| 22 | 22 | onClose: Subject<any>; |
| 23 | 23 | urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`; |
| 24 | + loading = false; | |
| 24 | 25 | |
| 25 | 26 | constructor( |
| 26 | 27 | public modalPromocion: BsModalRef, |
| ... | ... | @@ -35,6 +36,7 @@ export class PromocionComponent implements OnInit { |
| 35 | 36 | |
| 36 | 37 | ngOnInit() { |
| 37 | 38 | this.getPromociones(); |
| 39 | + this.loading = true; | |
| 38 | 40 | } |
| 39 | 41 | |
| 40 | 42 | selectPromo(promo: IArticulo) { |
| ... | ... | @@ -93,6 +95,7 @@ export class PromocionComponent implements OnInit { |
| 93 | 95 | this.promocionService.getPromociones(sector, codigo) |
| 94 | 96 | .subscribe((res: IArticulo[]) => { |
| 95 | 97 | this.promociones = res; |
| 98 | + this.loading = false; | |
| 96 | 99 | }, error => { console.error(error); }); |
| 97 | 100 | } |
| 98 | 101 |