Commit c6a2b69ce66f4e97189dbf5b4b6b6da9153b9a8b

Authored by Benjamin Rodriguez
Exists in develop

Merge branch 'develop' of git.focasoftware.com:angular/autoservicio-axion

src/app/shared/sinonimo/sinonimo.component.html
1 1 <div class="bg-primary rounded text-white">
2 2 <div class="modal-header">
3   - <p class="h4">Elige una opción</p>
  3 + <p class="h4 col-6 px-0 align-self-center">Eliga opciones {{sinonimos.length}}</p>
  4 + <div class="col-6 text-right">
  5 + <p *ngFor="let s of sinonimos; let i = index">
  6 + <span
  7 + class="pr-2 btn-effect"
  8 + (click)="scrollTo(i)">
  9 + Ir a opción {{i+1}}</span>
  10 + <i class="far fa-hand-point-left"></i>
  11 + </p>
  12 + </div>
4 13 </div>
5 14  
6 15 <div class="modal-body lista-sinonimos scroll-y-visible my-2 mr-2">
7 16 <div *ngFor="let s of sinonimos; let i = index">
  17 + <div [id]="i"></div>
8 18 <hr [hidden]="i === 0" class="bg-white">
9 19 <div *ngFor="let articulo of s.productos">
10 20 <div class="custom-control custom-checkbox">
src/app/shared/sinonimo/sinonimo.component.ts
... ... @@ -4,6 +4,7 @@ import { IArticulo } from &#39;src/app/interfaces/IArticulo&#39;;
4 4 import { BsModalRef } from 'ngx-bootstrap/modal';
5 5 import { Subject, forkJoin } from 'rxjs';
6 6 import { ArticuloService } from 'src/app/services/articulo/articulo.service';
  7 +import { element } from 'protractor';
7 8  
8 9 @Component({
9 10 selector: 'app-sinonimo',
... ... @@ -73,4 +74,9 @@ export class SinonimoComponent implements OnInit {
73 74 }, err => console.error(err));
74 75 }
75 76  
  77 + scrollTo(index: number) {
  78 + const element = document.getElementById(index.toString());
  79 + element.scrollIntoView({ behavior: "smooth", block: "center" });
  80 + }
  81 +
76 82 }