Commit c81c434e09dcd5559bae71f12fbc71d050af1d18
Exists in
develop
Merge branch 'develop' into 'develop'
Develop See merge request !75
Showing
3 changed files
Show diff stats
src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.ts
1 | import { Component, OnInit, HostListener, Output, EventEmitter } from '@angular/core'; | 1 | import { Component, OnInit, HostListener, Output, EventEmitter } from '@angular/core'; |
2 | import { ICategoria } from 'src/app/interfaces/ICategoria'; | 2 | import { ICategoria } from 'src/app/interfaces/ICategoria'; |
3 | import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service'; | 3 | import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service'; |
4 | import { CategoriaService } from 'src/app/services/categoria/categoria.service'; | 4 | import { CategoriaService } from 'src/app/services/categoria/categoria.service'; |
5 | import { APP_SETTINGS } from 'src/etc/AppSettings'; | 5 | import { APP_SETTINGS } from 'src/etc/AppSettings'; |
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | selector: 'app-filtro-categorias', | 8 | selector: 'app-filtro-categorias', |
9 | templateUrl: './filtro-categorias.component.html', | 9 | templateUrl: './filtro-categorias.component.html', |
10 | styleUrls: ['./filtro-categorias.component.scss'] | 10 | styleUrls: ['./filtro-categorias.component.scss'] |
11 | }) | 11 | }) |
12 | export class FiltroCategoriasComponent implements OnInit { | 12 | export class FiltroCategoriasComponent implements OnInit { |
13 | @Output() getProductos = new EventEmitter<any>(); | 13 | @Output() getProductos = new EventEmitter<any>(); |
14 | @Output() setProductos = new EventEmitter<any>(); | 14 | @Output() setProductos = new EventEmitter<any>(); |
15 | @Output() filterItems = new EventEmitter<any>(); | 15 | @Output() filterItems = new EventEmitter<any>(); |
16 | categorias: ICategoria[] = []; | 16 | categorias: ICategoria[] = []; |
17 | timeoutHandler: any; | 17 | timeoutHandler: any; |
18 | categoriaActive = null; | 18 | categoriaActive = null; |
19 | allActive = true; | 19 | allActive = true; |
20 | queMostrar = 'todos'; | 20 | queMostrar = 'todos'; |
21 | urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; | 21 | urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; |
22 | 22 | ||
23 | constructor( | 23 | constructor( |
24 | private categoriaService: CategoriaService, | 24 | private categoriaService: CategoriaService, |
25 | private inactiveScreen: InactiveScreenService, | 25 | private inactiveScreen: InactiveScreenService, |
26 | ) { } | 26 | ) { } |
27 | 27 | ||
28 | ngOnInit() { | 28 | ngOnInit() { |
29 | this.mediaPantalla(); | 29 | this.mediaPantalla(); |
30 | } | 30 | } |
31 | 31 | ||
32 | getCategorias() { | 32 | getCategorias() { |
33 | this.categoriaService.getAll() | 33 | this.categoriaService.getAll() |
34 | .subscribe((categorias: ICategoria[]) => { | 34 | .subscribe((categorias: ICategoria[]) => { |
35 | switch (this.queMostrar) { | 35 | switch (this.queMostrar) { |
36 | case 'todos': | 36 | case 'todos': |
37 | this.categorias = categorias; | 37 | this.categorias = categorias; |
38 | this.categoriaActive = 0; | 38 | this.categoriaActive = 0; |
39 | break; | 39 | break; |
40 | case 'promociones': | 40 | case 'promociones': |
41 | this.categorias = categorias; | 41 | this.categorias = categorias; |
42 | this.categoriaActive = 19; | 42 | this.categoriaActive = 19; |
43 | break; | 43 | break; |
44 | case 'ordenar': | 44 | case 'ordenar': |
45 | this.categorias = categorias.filter((categoria: ICategoria) => { | 45 | this.categorias = categorias.filter((categoria: ICategoria) => { |
46 | return categoria.ES_PEDIDO; | 46 | return categoria.ES_PEDIDO; |
47 | }); | 47 | }); |
48 | this.categoriaActive = 4; | 48 | this.categoriaActive = 4; |
49 | break; | 49 | break; |
50 | default: | 50 | default: |
51 | this.categorias = categorias; | 51 | this.categorias = categorias; |
52 | this.categoriaActive = 0; | 52 | this.categoriaActive = 0; |
53 | break; | 53 | break; |
54 | } | 54 | } |
55 | !localStorage.getItem('articulos') ? | 55 | !localStorage.getItem('articulos') ? |
56 | this.getProductos.emit() : | 56 | this.getProductos.emit() : |
57 | this.setProductos.emit(); | 57 | this.setProductos.emit(); |
58 | }); | 58 | }); |
59 | this.mediaPantalla(); | 59 | this.mediaPantalla(); |
60 | } | 60 | } |
61 | 61 | ||
62 | selectCategoria(index: number, idCategoria?: number) { | 62 | selectCategoria(index: number, idCategoria?: number) { |
63 | if (this.categoriaActive === idCategoria) return; | 63 | if (this.categoriaActive === idCategoria) return; |
64 | this.categoriaActive = idCategoria; | 64 | this.categoriaActive = idCategoria; |
65 | this.allActive = idCategoria === 0 ? true : false; | 65 | this.allActive = idCategoria === 0 ? true : false; |
66 | this.categorias.forEach((categoria, i) => { | 66 | this.categorias.forEach((categoria, i) => { |
67 | categoria.selected = index === i ? true : false; | 67 | categoria.selected = index === i ? true : false; |
68 | }); | 68 | }); |
69 | this.filterItems.emit(); | 69 | this.filterItems.emit(); |
70 | } | 70 | } |
71 | 71 | ||
72 | @HostListener('scroll', ['$event']) | 72 | @HostListener('scroll', ['$event']) |
73 | scrollEvent(event: Event) { | 73 | scrollEvent(event: Event) { |
74 | clearTimeout(this.inactiveScreen.timerReposo); | 74 | clearTimeout(this.inactiveScreen.timerReposo); |
75 | this.inactiveScreen.startTimeOutInactividad(); | 75 | this.inactiveScreen.startTimeOutInactividad(); |
76 | } | 76 | } |
77 | 77 | ||
78 | mouseup() { | 78 | mouseup() { |
79 | if (!this.timeoutHandler) return; | 79 | if (!this.timeoutHandler) return; |
80 | clearInterval(this.timeoutHandler); | 80 | clearInterval(this.timeoutHandler); |
81 | } | 81 | } |
82 | 82 | ||
83 | scrollY(el: HTMLElement, value) { | 83 | scrollY(el: HTMLElement, value) { |
84 | el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); | 84 | el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); |
85 | this.timeoutHandler = setInterval(() => { | 85 | this.timeoutHandler = setInterval(() => { |
86 | el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); | 86 | el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); |
87 | }, 500); | 87 | }, 500); |
88 | } | 88 | } |
89 | 89 | ||
90 | mediaPantalla() { | 90 | mediaPantalla() { |
91 | if ($('body').hasClass('media-pantalla')) { | 91 | if ($('body').hasClass('media-pantalla')) { |
92 | $('.cat-content,#cat-content') | 92 | $('.cat-content,#cat-content') |
93 | .addClass('media-pantalla') | 93 | .addClass('media-pantalla') |
94 | .addBack('media-pantalla'); | 94 | .addBack('media-pantalla'); |
95 | } | 95 | } |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 |
src/app/shared/header-publicidad/header-publicidad.component.ts
1 | import { Component, OnInit, TemplateRef } from '@angular/core'; | 1 | import { Component, OnInit, TemplateRef } from '@angular/core'; |
2 | import { APP_SETTINGS } from 'src/etc/AppSettings'; | 2 | import { APP_SETTINGS } from 'src/etc/AppSettings'; |
3 | import { IPublicidad } from 'src/app/interfaces/IPublicidad'; | 3 | import { IPublicidad } from 'src/app/interfaces/IPublicidad'; |
4 | import { PublicidadService } from 'src/app/services/publicidad/publicidad.service'; | 4 | import { PublicidadService } from 'src/app/services/publicidad/publicidad.service'; |
5 | import { IArticulo } from 'src/app/interfaces/IArticulo'; | 5 | import { IArticulo } from 'src/app/interfaces/IArticulo'; |
6 | import { PromocionComponent } from '../promocion/promocion.component'; | 6 | import { PromocionComponent } from '../promocion/promocion.component'; |
7 | import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal'; | 7 | import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal'; |
8 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; | 8 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
9 | import { ConfirmacionComponent } from '../confirmacion/confirmacion.component'; | 9 | import { ConfirmacionComponent } from '../confirmacion/confirmacion.component'; |
10 | import { SinonimoService } from 'src/app/services/sinonimo/sinonimo.service'; | 10 | import { SinonimoService } from 'src/app/services/sinonimo/sinonimo.service'; |
11 | import { ISinonimo } from 'src/app/interfaces/ISinonimo'; | 11 | import { ISinonimo } from 'src/app/interfaces/ISinonimo'; |
12 | import { SinonimoComponent } from '../sinonimo/sinonimo.component'; | 12 | import { SinonimoComponent } from '../sinonimo/sinonimo.component'; |
13 | 13 | ||
14 | @Component({ | 14 | @Component({ |
15 | selector: 'app-header-publicidad', | 15 | selector: 'app-header-publicidad', |
16 | templateUrl: './header-publicidad.component.html', | 16 | templateUrl: './header-publicidad.component.html', |
17 | styleUrls: ['./header-publicidad.component.scss'] | 17 | styleUrls: ['./header-publicidad.component.scss'] |
18 | }) | 18 | }) |
19 | export class HeaderPublicidadComponent implements OnInit { | 19 | export class HeaderPublicidadComponent implements OnInit { |
20 | urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; | 20 | urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; |
21 | publicidades: IPublicidad[] = []; | 21 | publicidades: IPublicidad[] = []; |
22 | modalRef: BsModalRef; | 22 | modalRef: BsModalRef; |
23 | 23 | ||
24 | constructor( | 24 | constructor( |
25 | private publicidadService: PublicidadService, | 25 | private publicidadService: PublicidadService, |
26 | private articuloService: ArticuloService, | 26 | private articuloService: ArticuloService, |
27 | private modalService: BsModalService, | 27 | private modalService: BsModalService, |
28 | private sinonimoService: SinonimoService | 28 | private sinonimoService: SinonimoService |
29 | ) { } | 29 | ) { } |
30 | 30 | ||
31 | ngOnInit() { | 31 | ngOnInit() { |
32 | this.getPublicidades(); | 32 | this.getPublicidades(); |
33 | this.mediaPantalla(); | 33 | this.mediaPantalla(); |
34 | } | 34 | } |
35 | 35 | ||
36 | getPublicidades() { | 36 | getPublicidades() { |
37 | this.publicidadService.getAll() | 37 | this.publicidadService.getAll() |
38 | .subscribe((res: IPublicidad[]) => { | 38 | .subscribe((res: IPublicidad[]) => { |
39 | this.publicidades = res; | 39 | this.publicidades = res; |
40 | }, err => console.error(err)); | 40 | }, err => console.error(err)); |
41 | } | 41 | } |
42 | 42 | ||
43 | elegirArticulo(publicidad: IPublicidad) { | 43 | elegirArticulo(publicidad: IPublicidad) { |
44 | if (publicidad.id_articulo) this.getByID(publicidad.id_articulo); | 44 | if (publicidad.id_articulo) this.getByID(publicidad.id_articulo); |
45 | } | 45 | } |
46 | 46 | ||
47 | getByID(id: number) { | 47 | getByID(id: number) { |
48 | this.articuloService.getById(id) | 48 | this.articuloService.getById(id) |
49 | .subscribe((res: IArticulo) => { | 49 | .subscribe((res: IArticulo) => { |
50 | if (res.FPP) { | 50 | if (res.FPP) { |
51 | this.openModalPromos(res); | 51 | this.openModalPromos(res); |
52 | return; | 52 | return; |
53 | } else { | 53 | } else { |
54 | this.openModalConfirmacion(res); | 54 | this.openModalConfirmacion(res); |
55 | return; | 55 | return; |
56 | } | 56 | } |
57 | }, err => console.error(err)); | 57 | }, err => console.error(err)); |
58 | } | 58 | } |
59 | 59 | ||
60 | openModalPromos(articulo: IArticulo) { | 60 | openModalPromos(articulo: IArticulo) { |
61 | this.modalRef = this.modalService.show(PromocionComponent, | 61 | this.modalRef = this.modalService.show(PromocionComponent, |
62 | { | 62 | { |
63 | initialState: { | 63 | initialState: { |
64 | idArticulo: articulo.id | 64 | idArticulo: articulo.id |
65 | }, | 65 | }, |
66 | class: 'modal-promo modal-dialog-centered' | 66 | class: 'modal-promo modal-dialog-centered' |
67 | }); | 67 | }); |
68 | } | 68 | } |
69 | 69 | ||
70 | openModalConfirmacion(articulo: IArticulo) { | 70 | openModalConfirmacion(articulo: IArticulo) { |
71 | this.modalRef = this.modalService.show(ConfirmacionComponent, | 71 | this.modalRef = this.modalService.show(ConfirmacionComponent, |
72 | { | 72 | { |
73 | initialState: { | 73 | initialState: { |
74 | titleMessage: articulo.DET_LAR, | 74 | titleMessage: articulo.DET_LAR, |
75 | imagenPath: articulo.imagenes.length ? articulo.imagenes[0].imagen : 'assets/img/imagen-no-encontrada.jpg', | 75 | imagenPath: articulo.imagenes.length ? articulo.imagenes[0].imagen : 'assets/img/imagen-no-encontrada.jpg', |
76 | footerMessageFirst: `¿DESEA AGREGAR ESTE ARTÍCULO`, | 76 | footerMessageFirst: `¿DESEA AGREGAR ESTE ARTÍCULO`, |
77 | footerMessageSecond: `a su carrito?`, | 77 | footerMessageSecond: `a su carrito?`, |
78 | footerConfirmation: articulo.PreVen, | 78 | footerConfirmation: articulo.PreVen, |
79 | footerClose: `volver` | 79 | footerClose: `volver` |
80 | }, | 80 | }, |
81 | class: 'modal-promo modal-dialog-centered' | 81 | class: 'modal-promo modal-dialog-centered' |
82 | }); | 82 | }); |
83 | this.modalRef.content.onClose.subscribe(() => { | 83 | this.modalRef.content.onClose.subscribe(() => { |
84 | this.sinonimoService.getSinonimos(articulo.CodSec, articulo.CodArt) | 84 | this.sinonimoService.getSinonimos(articulo.CodSec, articulo.CodArt) |
85 | .subscribe((res: ISinonimo[]) => { | 85 | .subscribe((res: ISinonimo[]) => { |
86 | if (res.length) { | 86 | if (res.length) { |
87 | const sinonimos = []; | ||
88 | const gruposArticulos = _.groupBy(res[0].productos, 'ID_SIN'); | ||
89 | Object.keys(gruposArticulos).forEach(key => { | ||
90 | sinonimos.push({ productos: gruposArticulos[key] }); | ||
91 | }); | ||
92 | res = sinonimos; | ||
87 | this.openModalSinonimos(res, articulo); | 93 | this.openModalSinonimos(res, articulo); |
88 | } else { | 94 | } else { |
89 | articulo.cantidad = 1; | 95 | articulo.cantidad = 1; |
90 | this.articuloService.setArticulo(articulo); | 96 | this.articuloService.setArticulo(articulo); |
91 | } | 97 | } |
92 | }, err => console.error(err)); | 98 | }, err => console.error(err)); |
93 | }); | 99 | }); |
94 | this.mediaPantalla(); | 100 | this.mediaPantalla(); |
95 | } | 101 | } |
96 | 102 | ||
97 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { | 103 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { |
98 | const modalSinonimo = this.modalService.show(SinonimoComponent, { | 104 | const modalSinonimo = this.modalService.show(SinonimoComponent, { |
99 | initialState: { sinonimos: sinonimosData }, | 105 | initialState: { sinonimos: sinonimosData }, |
100 | class: 'modal-promo modal-dialog-centered' | 106 | class: 'modal-promo modal-dialog-centered' |
101 | }); | 107 | }); |
102 | modalSinonimo.content.onClose | 108 | modalSinonimo.content.onClose |
103 | .subscribe((res: any) => { | 109 | .subscribe((res: any) => { |
104 | for (const a of articulo.productos) { | 110 | for (const a of articulo.productos) { |
105 | if (a.idSinonimo === res.ID_SIN) { | 111 | for (const aRes of res.articulos) { |
106 | a.CODA = res.articulo.CodArt; | 112 | if (a.idSinonimo === aRes.ID_SIN) { |
107 | a.CodArt = res.articulo.CodArt; | 113 | a.CODA = aRes.CodArt; |
108 | a.SECA = res.articulo.CodSec; | 114 | a.CodArt = aRes.CodArt; |
109 | a.CodSec = res.articulo.CodSec; | 115 | a.SECA = aRes.CodSec; |
110 | a.PreVen = res.articulo.PreVen; | 116 | aRes.CodSec = aRes.CodSec; |
111 | a.id = res.articulo.id; | 117 | a.PreVen = aRes.PreVen; |
112 | a.DET_LAR = res.articulo.DET_LAR; | 118 | a.id = aRes.id; |
113 | a.DetArt = res.articulo.DetArt; | 119 | a.DET_LAR = aRes.DET_LAR; |
120 | a.DetArt = aRes.DetArt; | ||
121 | } | ||
114 | } | 122 | } |
115 | } | 123 | } |
116 | this.articuloService.setArticulo(articulo); | 124 | this.articuloService.setArticulo(articulo); |
117 | }); | 125 | }); |
118 | } | 126 | } |
119 | 127 | ||
120 | mediaPantalla() { | 128 | mediaPantalla() { |
121 | if ($('body').hasClass('media-pantalla')) { | 129 | if ($('body').hasClass('media-pantalla')) { |
122 | $('#headerPublicidad,#headerPad').addClass('media-pantalla'); | 130 | $('#headerPublicidad,#headerPad').addClass('media-pantalla'); |
123 | } | 131 | } |
124 | } | 132 | } |
125 | } | 133 | } |
126 | 134 |
src/app/shared/sinonimo/sinonimo.component.ts
1 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
2 | import { ISinonimo } from 'src/app/interfaces/ISinonimo'; | 2 | import { ISinonimo } from 'src/app/interfaces/ISinonimo'; |
3 | import { IArticulo } from 'src/app/interfaces/IArticulo'; | 3 | import { IArticulo } from 'src/app/interfaces/IArticulo'; |
4 | import { BsModalRef } from 'ngx-bootstrap/modal'; | 4 | import { BsModalRef } from 'ngx-bootstrap/modal'; |
5 | import { Subject, forkJoin } from 'rxjs'; | 5 | import { Subject, forkJoin } from 'rxjs'; |
6 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; | 6 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
7 | import { element } from 'protractor'; | 7 | import { element } from 'protractor'; |
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | selector: 'app-sinonimo', | 10 | selector: 'app-sinonimo', |
11 | templateUrl: './sinonimo.component.html', | 11 | templateUrl: './sinonimo.component.html', |
12 | styleUrls: ['./sinonimo.component.scss'] | 12 | styleUrls: ['./sinonimo.component.scss'] |
13 | }) | 13 | }) |
14 | export class SinonimoComponent implements OnInit { | 14 | export class SinonimoComponent implements OnInit { |
15 | sinonimos: ISinonimo[] = []; | 15 | sinonimos: ISinonimo[] = []; |
16 | isValid: boolean; | 16 | isValid: boolean; |
17 | onClose: Subject<any>; | 17 | onClose: Subject<any>; |
18 | articulosSelected: IArticulo[] = []; | 18 | articulosSelected: IArticulo[] = []; |
19 | 19 | ||
20 | constructor( | 20 | constructor( |
21 | private modalRef: BsModalRef, | 21 | private modalRef: BsModalRef, |
22 | private articuloService: ArticuloService, | 22 | private articuloService: ArticuloService, |
23 | ) { | 23 | ) { |
24 | this.onClose = new Subject(); | 24 | this.onClose = new Subject(); |
25 | this.articulosSelected.length = this.sinonimos.length; | 25 | this.articulosSelected.length = this.sinonimos.length; |
26 | } | 26 | } |
27 | 27 | ||
28 | ngOnInit() { } | 28 | ngOnInit() { } |
29 | 29 | ||
30 | selectSinonimo(index: number, articulo: IArticulo) { | 30 | selectSinonimo(index: number, articulo: IArticulo) { |
31 | for (const a of this.sinonimos[index].productos) { | 31 | for (const a of this.sinonimos[index].productos) { |
32 | a.seleccionado = false; | 32 | a.seleccionado = false; |
33 | } | 33 | } |
34 | articulo.seleccionado = true; | 34 | articulo.seleccionado = true; |
35 | this.articulosSelected[index] = articulo; | 35 | this.articulosSelected[index] = articulo; |
36 | } | 36 | } |
37 | 37 | ||
38 | validate() { | 38 | validate() { |
39 | this.isValid = true; | 39 | this.isValid = true; |
40 | for (const s of this.sinonimos) { | 40 | for (const s of this.sinonimos) { |
41 | for (const a of s.productos) { | 41 | for (const a of s.productos) { |
42 | this.isValid = (!a.seleccionado) ? false : true; | 42 | this.isValid = (!a.seleccionado) ? false : true; |
43 | if (this.isValid) break; | 43 | if (this.isValid) break; |
44 | } | 44 | } |
45 | if (!this.isValid) break; | 45 | if (!this.isValid) break; |
46 | } | 46 | } |
47 | return !this.isValid ? 'disabled' : 'btn-effect'; | 47 | return !this.isValid ? 'disabled' : 'btn-effect'; |
48 | } | 48 | } |
49 | 49 | ||
50 | continue() { | 50 | continue() { |
51 | if (!this.isValid) return; | 51 | if (!this.isValid) return; |
52 | const ID_SINS = []; | 52 | const ID_SINS = []; |
53 | const observables = []; | 53 | const observables = []; |
54 | 54 | ||
55 | for (const articulo of this.articulosSelected) { | 55 | for (const articulo of this.articulosSelected) { |
56 | ID_SINS.push(articulo.ID_SIN); | 56 | ID_SINS.push(articulo.ID_SIN); |
57 | } | 57 | } |
58 | 58 | ||
59 | for (const articulo of this.articulosSelected) { | 59 | for (const articulo of this.articulosSelected) { |
60 | observables.push(this.articuloService.getById(articulo.id)); | 60 | observables.push(this.articuloService.getById(articulo.id)); |
61 | } | 61 | } |
62 | 62 | ||
63 | forkJoin(observables) | 63 | forkJoin(observables) |
64 | .subscribe((res: IArticulo[]) => { | 64 | .subscribe((res: IArticulo[]) => { |
65 | for (const articulo of res) { | 65 | for (const articulo of res) { |
66 | for (const ID_SIN of ID_SINS) { | 66 | for (const ID_SIN of ID_SINS) { |
67 | articulo.ID_SIN = ID_SIN; | 67 | articulo.ID_SIN = ID_SIN; |
68 | } | 68 | } |
69 | } | 69 | } |
70 | this.modalRef.hide(); | 70 | this.modalRef.hide(); |
71 | this.onClose.next({ | 71 | this.onClose.next({ |
72 | articulos: res, | 72 | articulos: res, |
73 | }); | 73 | }); |
74 | }, err => console.error(err)); | 74 | }, err => console.error(err)); |
75 | } | 75 | } |
76 | 76 | ||
77 | scrollTo(index: number) { | 77 | scrollTo(index: number) { |
78 | const element = document.getElementById(index.toString()); | 78 | const el = document.getElementById(index.toString()); |
79 | element.scrollIntoView({ behavior: 'smooth', block: 'center' }); | 79 | el.scrollIntoView({ behavior: 'smooth', block: 'center' }); |
80 | } | 80 | } |
81 | 81 | ||
82 | } | 82 | } |
83 | 83 |