Commit 1e131e1342fec22a00da06e20698401194632a00
1 parent
badd873503
Exists in
develop
Fix
Quitados metodos sin uso
Showing
2 changed files
with
0 additions
and
16 deletions
Show diff stats
src/app/modules/carrito/carrito.component.ts
1 | import { Component, OnInit, OnDestroy, HostListener } from '@angular/core'; | 1 | import { Component, OnInit, OnDestroy, HostListener } from '@angular/core'; |
2 | import { Location } from '@angular/common'; | 2 | import { Location } from '@angular/common'; |
3 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; | 3 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
4 | import { APP_SETTINGS } from 'src/etc/AppSettings'; | 4 | import { APP_SETTINGS } from 'src/etc/AppSettings'; |
5 | import { trigger, state, style, transition, animate } from '@angular/animations'; | 5 | import { trigger, state, style, transition, animate } from '@angular/animations'; |
6 | import { IArticulo } from 'src/app/interfaces/IArticulo'; | 6 | import { IArticulo } from 'src/app/interfaces/IArticulo'; |
7 | import { Router } from '@angular/router'; | 7 | import { Router } from '@angular/router'; |
8 | import { BsModalRef } from 'ngx-bootstrap/modal/public_api'; | 8 | import { BsModalRef } from 'ngx-bootstrap/modal/public_api'; |
9 | import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service'; | 9 | import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service'; |
10 | 10 | ||
11 | @Component({ | 11 | @Component({ |
12 | selector: 'app-carrito', | 12 | selector: 'app-carrito', |
13 | templateUrl: './carrito.component.html', | 13 | templateUrl: './carrito.component.html', |
14 | styleUrls: ['./carrito.component.scss'], | 14 | styleUrls: ['./carrito.component.scss'], |
15 | animations: [ | 15 | animations: [ |
16 | trigger('EnterLeave', [ | 16 | trigger('EnterLeave', [ |
17 | state('flyIn', style({ transform: 'translateX(0)' })), | 17 | state('flyIn', style({ transform: 'translateX(0)' })), |
18 | transition(':enter', [ | 18 | transition(':enter', [ |
19 | style({ transform: 'translateX(-100%)' }), | 19 | style({ transform: 'translateX(-100%)' }), |
20 | animate('1s ease-in') | 20 | animate('1s ease-in') |
21 | ]), | 21 | ]), |
22 | transition(':leave', [ | 22 | transition(':leave', [ |
23 | animate('1s ease-out', style({ transform: 'translateX(-100%)' })) | 23 | animate('1s ease-out', style({ transform: 'translateX(-100%)' })) |
24 | ]) | 24 | ]) |
25 | ]) | 25 | ]) |
26 | ] | 26 | ] |
27 | }) | 27 | }) |
28 | export class CarritoComponent implements OnInit, OnDestroy { | 28 | export class CarritoComponent implements OnInit, OnDestroy { |
29 | urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; | 29 | urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; |
30 | maxCantidad = 50; | 30 | maxCantidad = 50; |
31 | modalRef: BsModalRef; | 31 | modalRef: BsModalRef; |
32 | 32 | ||
33 | constructor( | 33 | constructor( |
34 | public articuloService: ArticuloService, | 34 | public articuloService: ArticuloService, |
35 | private location: Location, | 35 | private location: Location, |
36 | private router: Router, | 36 | private router: Router, |
37 | private inactiveScreen: InactiveScreenService, | 37 | private inactiveScreen: InactiveScreenService, |
38 | ) { } | 38 | ) { } |
39 | 39 | ||
40 | ngOnInit() { | 40 | ngOnInit() { |
41 | if (!this.articuloService.carrito.length) { | 41 | if (!this.articuloService.carrito.length) { |
42 | this.router.navigate(['']); | 42 | this.router.navigate(['']); |
43 | return; | 43 | return; |
44 | } | 44 | } |
45 | this.mediaPantallaP(); | 45 | this.mediaPantallaP(); |
46 | } | 46 | } |
47 | 47 | ||
48 | ngOnDestroy() { | 48 | ngOnDestroy() { |
49 | if (this.modalRef) this.modalRef.hide(); | 49 | if (this.modalRef) this.modalRef.hide(); |
50 | } | 50 | } |
51 | 51 | ||
52 | deleteArticulo(index: number) { | 52 | deleteArticulo(index: number) { |
53 | this.articuloService.deleteArticulo(index); | 53 | this.articuloService.deleteArticulo(index); |
54 | } | 54 | } |
55 | 55 | ||
56 | substractCant(articulo: IArticulo) { | ||
57 | this.articuloService.substractCant(articulo); | ||
58 | } | ||
59 | |||
60 | addCant(articulo: IArticulo) { | ||
61 | this.articuloService.addCant(articulo); | ||
62 | } | ||
63 | |||
64 | goBack() { | 56 | goBack() { |
65 | this.location.back(); | 57 | this.location.back(); |
66 | } | 58 | } |
67 | 59 | ||
68 | @HostListener('document:click', ['$event']) | 60 | @HostListener('document:click', ['$event']) |
69 | eventListener(event: Event) { | 61 | eventListener(event: Event) { |
70 | clearTimeout(this.inactiveScreen.timerReposo); | 62 | clearTimeout(this.inactiveScreen.timerReposo); |
71 | this.inactiveScreen.startTimeOutInactividad(); | 63 | this.inactiveScreen.startTimeOutInactividad(); |
72 | } | 64 | } |
73 | 65 | ||
74 | @HostListener('scroll', ['$event']) | 66 | @HostListener('scroll', ['$event']) |
75 | scrollEvent(event: Event) { | 67 | scrollEvent(event: Event) { |
76 | clearTimeout(this.inactiveScreen.timerReposo); | 68 | clearTimeout(this.inactiveScreen.timerReposo); |
77 | this.inactiveScreen.startTimeOutInactividad(); | 69 | this.inactiveScreen.startTimeOutInactividad(); |
78 | } | 70 | } |
79 | 71 | ||
80 | mediaPantallaP() { | 72 | mediaPantallaP() { |
81 | if ($('body').hasClass('media-pantalla')) { | 73 | if ($('body').hasClass('media-pantalla')) { |
82 | $('.carrito-content,.carrito-articulo').addClass('media-pantalla'); | 74 | $('.carrito-content,.carrito-articulo').addClass('media-pantalla'); |
83 | } | 75 | } |
84 | } | 76 | } |
85 | } | 77 | } |
86 | 78 |
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
1 | import { Component, OnInit, OnDestroy, HostListener } from '@angular/core'; | 1 | import { Component, OnInit, OnDestroy, HostListener } from '@angular/core'; |
2 | import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; | 2 | import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; |
3 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; | 3 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
4 | import { IArticulo } from 'src/app/interfaces/IArticulo'; | 4 | import { IArticulo } from 'src/app/interfaces/IArticulo'; |
5 | import { APP_SETTINGS } from 'src/etc/AppSettings'; | 5 | import { APP_SETTINGS } from 'src/etc/AppSettings'; |
6 | import { ICategoria } from 'src/app/interfaces/ICategoria'; | 6 | import { ICategoria } from 'src/app/interfaces/ICategoria'; |
7 | import { ISinonimo } from 'src/app/interfaces/ISinonimo'; | 7 | import { ISinonimo } from 'src/app/interfaces/ISinonimo'; |
8 | import { CategoriaService } from 'src/app/services/categoria/categoria.service'; | 8 | import { CategoriaService } from 'src/app/services/categoria/categoria.service'; |
9 | import { PromocionComponent } from 'src/app/shared/promocion/promocion.component'; | 9 | import { PromocionComponent } from 'src/app/shared/promocion/promocion.component'; |
10 | import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service'; | 10 | import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service'; |
11 | import { SinonimoService } from 'src/app/services/sinonimo/sinonimo.service'; | 11 | import { SinonimoService } from 'src/app/services/sinonimo/sinonimo.service'; |
12 | import { SinonimoComponent } from 'src/app/shared/sinonimo/sinonimo.component'; | 12 | import { SinonimoComponent } from 'src/app/shared/sinonimo/sinonimo.component'; |
13 | import { trigger, state, style, transition, animate } from '@angular/animations'; | 13 | import { trigger, state, style, transition, animate } from '@angular/animations'; |
14 | 14 | ||
15 | @Component({ | 15 | @Component({ |
16 | selector: 'app-seleccion-articulos', | 16 | selector: 'app-seleccion-articulos', |
17 | templateUrl: './seleccion-articulos.component.html', | 17 | templateUrl: './seleccion-articulos.component.html', |
18 | styleUrls: ['./seleccion-articulos.component.scss'], | 18 | styleUrls: ['./seleccion-articulos.component.scss'], |
19 | animations: [ | 19 | animations: [ |
20 | trigger('EnterLeave', [ | 20 | trigger('EnterLeave', [ |
21 | state('flyIn', style({ transform: 'translateY(0)' })), | 21 | state('flyIn', style({ transform: 'translateY(0)' })), |
22 | transition(':enter', [ | 22 | transition(':enter', [ |
23 | style({ transform: 'translateY(-100%)' }), | 23 | style({ transform: 'translateY(-100%)' }), |
24 | animate('0.5s ease-in') | 24 | animate('0.5s ease-in') |
25 | ]), | 25 | ]), |
26 | transition(':leave', [ | 26 | transition(':leave', [ |
27 | animate('0.5s ease-out', style({ transform: 'translateY(-100%)' })) | 27 | animate('0.5s ease-out', style({ transform: 'translateY(-100%)' })) |
28 | ]) | 28 | ]) |
29 | ]) | 29 | ]) |
30 | ] | 30 | ] |
31 | }) | 31 | }) |
32 | export class SeleccionArticulosComponent implements OnInit, OnDestroy { | 32 | export class SeleccionArticulosComponent implements OnInit, OnDestroy { |
33 | showSpinner = true; | 33 | showSpinner = true; |
34 | timeoutHandler: any; | 34 | timeoutHandler: any; |
35 | urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; | 35 | urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; |
36 | articulos: IArticulo[] = []; | 36 | articulos: IArticulo[] = []; |
37 | auxArticulos: IArticulo[] = []; | 37 | auxArticulos: IArticulo[] = []; |
38 | showQuantity = 100; | 38 | showQuantity = 100; |
39 | queMostrar = 'todos'; | 39 | queMostrar = 'todos'; |
40 | categoriaActive = null; | 40 | categoriaActive = null; |
41 | categorias: ICategoria[] = []; | 41 | categorias: ICategoria[] = []; |
42 | searchTerm = ''; | 42 | searchTerm = ''; |
43 | ordenandoByVendidos = true; | 43 | ordenandoByVendidos = true; |
44 | allActive = true; | 44 | allActive = true; |
45 | modalRef: BsModalRef; | 45 | modalRef: BsModalRef; |
46 | total = 0; | 46 | total = 0; |
47 | 47 | ||
48 | constructor( | 48 | constructor( |
49 | public articuloService: ArticuloService, | 49 | public articuloService: ArticuloService, |
50 | private categoriaService: CategoriaService, | 50 | private categoriaService: CategoriaService, |
51 | private sinonimoService: SinonimoService, | 51 | private sinonimoService: SinonimoService, |
52 | private modalService: BsModalService, | 52 | private modalService: BsModalService, |
53 | private inactiveScreen: InactiveScreenService, | 53 | private inactiveScreen: InactiveScreenService, |
54 | ) { } | 54 | ) { } |
55 | 55 | ||
56 | ngOnInit() { | 56 | ngOnInit() { |
57 | this.getCategorias(); | 57 | this.getCategorias(); |
58 | this.mediaPantalla(); | 58 | this.mediaPantalla(); |
59 | } | 59 | } |
60 | 60 | ||
61 | ngOnDestroy() { | 61 | ngOnDestroy() { |
62 | for (let i = 1; i <= this.modalService.getModalsCount(); i++) { | 62 | for (let i = 1; i <= this.modalService.getModalsCount(); i++) { |
63 | this.modalService.hide(i); | 63 | this.modalService.hide(i); |
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | getCategorias() { | 67 | getCategorias() { |
68 | this.categoriaService.getAll() | 68 | this.categoriaService.getAll() |
69 | .subscribe((categorias: ICategoria[]) => { | 69 | .subscribe((categorias: ICategoria[]) => { |
70 | switch (this.queMostrar) { | 70 | switch (this.queMostrar) { |
71 | case 'todos': | 71 | case 'todos': |
72 | this.categorias = categorias; | 72 | this.categorias = categorias; |
73 | this.categoriaActive = 0; | 73 | this.categoriaActive = 0; |
74 | break; | 74 | break; |
75 | case 'promociones': | 75 | case 'promociones': |
76 | this.categorias = categorias; | 76 | this.categorias = categorias; |
77 | this.categoriaActive = 19; | 77 | this.categoriaActive = 19; |
78 | break; | 78 | break; |
79 | case 'ordenar': | 79 | case 'ordenar': |
80 | this.categorias = categorias.filter((categoria: ICategoria) => { | 80 | this.categorias = categorias.filter((categoria: ICategoria) => { |
81 | return categoria.ES_PEDIDO; | 81 | return categoria.ES_PEDIDO; |
82 | }); | 82 | }); |
83 | this.categoriaActive = 4; | 83 | this.categoriaActive = 4; |
84 | break; | 84 | break; |
85 | default: | 85 | default: |
86 | this.categorias = categorias; | 86 | this.categorias = categorias; |
87 | this.categoriaActive = 0; | 87 | this.categoriaActive = 0; |
88 | break; | 88 | break; |
89 | } | 89 | } |
90 | !localStorage.getItem('articulos') ? | 90 | !localStorage.getItem('articulos') ? |
91 | this.getProductos() : | 91 | this.getProductos() : |
92 | this.setProductos(); | 92 | this.setProductos(); |
93 | }); | 93 | }); |
94 | } | 94 | } |
95 | 95 | ||
96 | getProductos() { | 96 | getProductos() { |
97 | this.articuloService.getAll() | 97 | this.articuloService.getAll() |
98 | .subscribe((result: IArticulo[]) => { | 98 | .subscribe((result: IArticulo[]) => { |
99 | this.articuloService.setArticulosSinImagen(result); | 99 | this.articuloService.setArticulosSinImagen(result); |
100 | if (this.queMostrar === 'ordenar') { | 100 | if (this.queMostrar === 'ordenar') { |
101 | this.categorias.forEach((categoria: ICategoria) => { | 101 | this.categorias.forEach((categoria: ICategoria) => { |
102 | const tempArticulos = result.filter((articulo: IArticulo) => { | 102 | const tempArticulos = result.filter((articulo: IArticulo) => { |
103 | return articulo.categoria_selfservice === categoria.id; | 103 | return articulo.categoria_selfservice === categoria.id; |
104 | }); | 104 | }); |
105 | result = tempArticulos; | 105 | result = tempArticulos; |
106 | }); | 106 | }); |
107 | } | 107 | } |
108 | localStorage.setItem('articulos', JSON.stringify(result)); | 108 | localStorage.setItem('articulos', JSON.stringify(result)); |
109 | this.setProductos(); | 109 | this.setProductos(); |
110 | }, (error) => { | 110 | }, (error) => { |
111 | this.showSpinner = false; | 111 | this.showSpinner = false; |
112 | console.error(error); | 112 | console.error(error); |
113 | }); | 113 | }); |
114 | } | 114 | } |
115 | 115 | ||
116 | setProductos() { | 116 | setProductos() { |
117 | this.articulos = JSON.parse(localStorage.getItem('articulos')); | 117 | this.articulos = JSON.parse(localStorage.getItem('articulos')); |
118 | this.filterItems(); | 118 | this.filterItems(); |
119 | } | 119 | } |
120 | 120 | ||
121 | filterItems() { | 121 | filterItems() { |
122 | if (this.categoriaActive === 0) { | 122 | if (this.categoriaActive === 0) { |
123 | this.auxArticulos = this.articulos; | 123 | this.auxArticulos = this.articulos; |
124 | return; | 124 | return; |
125 | } | 125 | } |
126 | this.auxArticulos = this.articulos.filter(x => { | 126 | this.auxArticulos = this.articulos.filter(x => { |
127 | return x.categoria_selfservice === this.categoriaActive; | 127 | return x.categoria_selfservice === this.categoriaActive; |
128 | }); | 128 | }); |
129 | this.ordenar(); | 129 | this.ordenar(); |
130 | } | 130 | } |
131 | 131 | ||
132 | ordenar() { | 132 | ordenar() { |
133 | if (this.ordenandoByVendidos) { | 133 | if (this.ordenandoByVendidos) { |
134 | this.auxArticulos.sort((a, b) => { | 134 | this.auxArticulos.sort((a, b) => { |
135 | return b.cantidadVendida - a.cantidadVendida; | 135 | return b.cantidadVendida - a.cantidadVendida; |
136 | }); | 136 | }); |
137 | } | 137 | } |
138 | } | 138 | } |
139 | 139 | ||
140 | selectCategoria(index: number, idCategoria?: number) { | 140 | selectCategoria(index: number, idCategoria?: number) { |
141 | if (this.categoriaActive === idCategoria) return; | 141 | if (this.categoriaActive === idCategoria) return; |
142 | this.categoriaActive = idCategoria; | 142 | this.categoriaActive = idCategoria; |
143 | this.allActive = idCategoria === 0 ? true : false; | 143 | this.allActive = idCategoria === 0 ? true : false; |
144 | this.categorias.forEach((categoria, i) => { | 144 | this.categorias.forEach((categoria, i) => { |
145 | categoria.selected = index === i ? true : false; | 145 | categoria.selected = index === i ? true : false; |
146 | }); | 146 | }); |
147 | this.filterItems(); | 147 | this.filterItems(); |
148 | } | 148 | } |
149 | 149 | ||
150 | selectArticulo(articulo: IArticulo) { | 150 | selectArticulo(articulo: IArticulo) { |
151 | this.getByID(articulo.id); | 151 | this.getByID(articulo.id); |
152 | } | 152 | } |
153 | 153 | ||
154 | getByID(id: number) { | 154 | getByID(id: number) { |
155 | this.articuloService.getById(id) | 155 | this.articuloService.getById(id) |
156 | .subscribe((res: IArticulo) => { | 156 | .subscribe((res: IArticulo) => { |
157 | if (res.FPP) { | 157 | if (res.FPP) { |
158 | this.openModalPromos(res); | 158 | this.openModalPromos(res); |
159 | } else { | 159 | } else { |
160 | this.getSinonimos(res); | 160 | this.getSinonimos(res); |
161 | } | 161 | } |
162 | }, err => console.error(err)); | 162 | }, err => console.error(err)); |
163 | } | 163 | } |
164 | 164 | ||
165 | getSinonimos(articulo: IArticulo) { | 165 | getSinonimos(articulo: IArticulo) { |
166 | this.sinonimoService.getSinonimos(articulo.CodSec, articulo.CodArt) | 166 | this.sinonimoService.getSinonimos(articulo.CodSec, articulo.CodArt) |
167 | .subscribe((res: ISinonimo[]) => { | 167 | .subscribe((res: ISinonimo[]) => { |
168 | if (res.length) { | 168 | if (res.length) { |
169 | this.openModalSinonimos(res, articulo); | 169 | this.openModalSinonimos(res, articulo); |
170 | } else { | 170 | } else { |
171 | this.articuloService.setArticulo(articulo); | 171 | this.articuloService.setArticulo(articulo); |
172 | } | 172 | } |
173 | }); | 173 | }); |
174 | } | 174 | } |
175 | 175 | ||
176 | openModalPromos(articulo: IArticulo) { | 176 | openModalPromos(articulo: IArticulo) { |
177 | this.modalRef = this.modalService.show(PromocionComponent, { | 177 | this.modalRef = this.modalService.show(PromocionComponent, { |
178 | initialState: { articulosPromo: [articulo] }, | 178 | initialState: { articulosPromo: [articulo] }, |
179 | class: 'modal-promo modal-dialog-centered' | 179 | class: 'modal-promo modal-dialog-centered' |
180 | }); | 180 | }); |
181 | } | 181 | } |
182 | 182 | ||
183 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { | 183 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { |
184 | this.modalRef = this.modalService.show(SinonimoComponent, { | 184 | this.modalRef = this.modalService.show(SinonimoComponent, { |
185 | initialState: { sinonimos: sinonimosData }, | 185 | initialState: { sinonimos: sinonimosData }, |
186 | class: 'modal-promo modal-dialog-centered' | 186 | class: 'modal-promo modal-dialog-centered' |
187 | }); | 187 | }); |
188 | 188 | ||
189 | this.modalRef.content.onClose | 189 | this.modalRef.content.onClose |
190 | .subscribe((res: any) => { | 190 | .subscribe((res: any) => { |
191 | for (const a of articulo.productos) { | 191 | for (const a of articulo.productos) { |
192 | if (a.idSinonimo === res.ID_SIN) { | 192 | if (a.idSinonimo === res.ID_SIN) { |
193 | a.CODA = res.articulo.CodArt; | 193 | a.CODA = res.articulo.CodArt; |
194 | a.CodArt = res.articulo.CodArt; | 194 | a.CodArt = res.articulo.CodArt; |
195 | a.SECA = res.articulo.CodSec; | 195 | a.SECA = res.articulo.CodSec; |
196 | a.CodSec = res.articulo.CodSec; | 196 | a.CodSec = res.articulo.CodSec; |
197 | a.PreVen = res.articulo.PreVen; | 197 | a.PreVen = res.articulo.PreVen; |
198 | a.id = res.articulo.id; | 198 | a.id = res.articulo.id; |
199 | a.DET_LAR = res.articulo.DET_LAR; | 199 | a.DET_LAR = res.articulo.DET_LAR; |
200 | a.DetArt = res.articulo.DetArt; | 200 | a.DetArt = res.articulo.DetArt; |
201 | } | 201 | } |
202 | } | 202 | } |
203 | this.articuloService.setArticulo(articulo); | 203 | this.articuloService.setArticulo(articulo); |
204 | }); | 204 | }); |
205 | } | 205 | } |
206 | 206 | ||
207 | deleteArticulo(index: number) { | 207 | deleteArticulo(index: number) { |
208 | this.articuloService.deleteArticulo(index); | 208 | this.articuloService.deleteArticulo(index); |
209 | } | 209 | } |
210 | 210 | ||
211 | substractCant(articulo: IArticulo) { | ||
212 | this.articuloService.substractCant(articulo); | ||
213 | } | ||
214 | |||
215 | addCant(articulo: IArticulo) { | ||
216 | this.articuloService.addCant(articulo); | ||
217 | } | ||
218 | |||
219 | increaseShow() { | 211 | increaseShow() { |
220 | this.showQuantity += 100; | 212 | this.showQuantity += 100; |
221 | } | 213 | } |
222 | 214 | ||
223 | @HostListener('scroll', ['$event']) | 215 | @HostListener('scroll', ['$event']) |
224 | scrollEvent(event: Event) { | 216 | scrollEvent(event: Event) { |
225 | clearTimeout(this.inactiveScreen.timerReposo); | 217 | clearTimeout(this.inactiveScreen.timerReposo); |
226 | this.inactiveScreen.startTimeOutInactividad(); | 218 | this.inactiveScreen.startTimeOutInactividad(); |
227 | } | 219 | } |
228 | 220 | ||
229 | mouseup() { | 221 | mouseup() { |
230 | if (!this.timeoutHandler) return; | 222 | if (!this.timeoutHandler) return; |
231 | clearInterval(this.timeoutHandler); | 223 | clearInterval(this.timeoutHandler); |
232 | } | 224 | } |
233 | 225 | ||
234 | scrollY(el: HTMLElement, value) { | 226 | scrollY(el: HTMLElement, value) { |
235 | el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); | 227 | el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); |
236 | this.timeoutHandler = setInterval(() => { | 228 | this.timeoutHandler = setInterval(() => { |
237 | el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); | 229 | el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); |
238 | }, 500); | 230 | }, 500); |
239 | } | 231 | } |
240 | 232 | ||
241 | scrollX(el: HTMLElement, value) { | 233 | scrollX(el: HTMLElement, value) { |
242 | el.scroll({ behavior: 'smooth', left: value + el.scrollLeft }); | 234 | el.scroll({ behavior: 'smooth', left: value + el.scrollLeft }); |
243 | this.timeoutHandler = setInterval(() => { | 235 | this.timeoutHandler = setInterval(() => { |
244 | el.scroll({ behavior: 'smooth', left: value + el.scrollLeft }); | 236 | el.scroll({ behavior: 'smooth', left: value + el.scrollLeft }); |
245 | }, 500); | 237 | }, 500); |
246 | } | 238 | } |
247 | 239 | ||
248 | mediaPantalla() { | 240 | mediaPantalla() { |
249 | if ($('body').hasClass('media-pantalla')) { | 241 | if ($('body').hasClass('media-pantalla')) { |
250 | $('.cat-content,#content,.cat-btn,#boxCarrito,.cat-box,.img-categoria').addClass('media-pantalla').addBack('media-pantalla'); | 242 | $('.cat-content,#content,.cat-btn,#boxCarrito,.cat-box,.img-categoria').addClass('media-pantalla').addBack('media-pantalla'); |
251 | } | 243 | } |
252 | } | 244 | } |
253 | } | 245 | } |
254 | 246 |