diff --git a/src/app/modules/seleccion-productos/seleccion-productos.component.html b/src/app/modules/seleccion-productos/seleccion-productos.component.html
index 69026d1..228977b 100644
--- a/src/app/modules/seleccion-productos/seleccion-productos.component.html
+++ b/src/app/modules/seleccion-productos/seleccion-productos.component.html
@@ -29,7 +29,7 @@
(contextmenu)="false"
class="h-100 d-block mx-auto rotate-90-neg"
src="assets/img/ir-color.svg"
- (mousedown)="scroll(templateCategorias, -80)"
+ (mousedown)="scrollY(templateCategorias, -80)"
(mouseup)="mouseup()"
(mouseleave)="mouseup()">
@@ -55,7 +55,7 @@
(contextmenu)="false"
class="h-100 d-block mx-auto rotate-90"
src="assets/img/ir-color.svg"
- (mousedown)="scroll(templateCategorias, 80)"
+ (mousedown)="scrollY(templateCategorias, 80)"
(mouseup)="mouseup()"
(mouseleave)="mouseup()">
@@ -92,9 +92,9 @@
-
PRODUCTOS EN TÚ CARRITO DE COMPRAS
+
PRODUCTOS EN TÚ CARRITO DE COMPRAS
-
\ No newline at end of file
+
diff --git a/src/app/modules/seleccion-productos/seleccion-productos.component.ts b/src/app/modules/seleccion-productos/seleccion-productos.component.ts
index 27703f4..5cb27d7 100644
--- a/src/app/modules/seleccion-productos/seleccion-productos.component.ts
+++ b/src/app/modules/seleccion-productos/seleccion-productos.component.ts
@@ -1,22 +1,21 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit } from "@angular/core";
@Component({
- selector: 'app-seleccion-productos',
- templateUrl: './seleccion-productos.component.html',
- styleUrls: ['./seleccion-productos.component.scss']
+ selector: "app-seleccion-productos",
+ templateUrl: "./seleccion-productos.component.html",
+ styleUrls: ["./seleccion-productos.component.scss"]
})
export class SeleccionProductosComponent implements OnInit {
timeoutHandler: any;
categorias = [
{ id: 1, selected: false },
{ id: 2, selected: false },
- { id: 3, selected: false },
+ { id: 3, selected: false }
];
- constructor() { }
+ constructor() {}
- ngOnInit() {
- }
+ ngOnInit() {}
selectCategoria(index: number) {
this.categorias.forEach((categoria, i) => {
@@ -29,11 +28,17 @@ export class SeleccionProductosComponent implements OnInit {
clearInterval(this.timeoutHandler);
}
- scroll(el: HTMLElement, value) {
- el.scroll({ behavior: 'smooth', top: (value + el.scrollTop) });
+ scrollY(el: HTMLElement, value) {
+ el.scroll({ behavior: "smooth", top: value + el.scrollTop });
this.timeoutHandler = setInterval(() => {
- el.scroll({ behavior: 'smooth', top: (value + el.scrollTop) });
+ el.scroll({ behavior: "smooth", top: value + el.scrollTop });
}, 500);
}
+ scrollX(el: HTMLElement, value) {
+ el.scroll({ behavior: "smooth", left: value + el.scrollLeft });
+ this.timeoutHandler = setInterval(() => {
+ el.scroll({ behavior: "smooth", left: value + el.scrollLeft });
+ }, 500);
+ }
}