Commit 6bf89ab1586d737f1fb485e4de9c5ab7509a8b76
Exists in
develop
Merge branch 'develop' into 'develop'
Develop See merge request !131
Showing
2 changed files
Show diff stats
src/app/shared/sinonimo/sinonimo.component.html
... | ... | @@ -69,9 +69,10 @@ |
69 | 69 | VOLVER |
70 | 70 | </div> |
71 | 71 | <div |
72 | + [ngClass]="validateNext()" | |
72 | 73 | *ngIf="currentIndex != sinonimos.length-1" |
73 | - class="d-inline-block py-1 bg-white badge-pill text-primary btn-effect ml-auto fade-in-left" | |
74 | - (click)="currentIndex = currentIndex+1"> | |
74 | + class="d-inline-block py-1 bg-white badge-pill text-primary ml-auto fade-in-left" | |
75 | + (click)="goNext()"> | |
75 | 76 | SIGUIENTE |
76 | 77 | <img |
77 | 78 | draggable="false" |
src/app/shared/sinonimo/sinonimo.component.ts
... | ... | @@ -45,6 +45,17 @@ export class SinonimoComponent implements OnInit { |
45 | 45 | return !this.isValid ? 'disabled' : 'btn-effect'; |
46 | 46 | } |
47 | 47 | |
48 | + validateNext() { | |
49 | + const sinonimo = this.sinonimos[this.currentIndex] | |
50 | + sinonimo.selected = (sinonimo.cantidadRestante > 0) ? false : true; | |
51 | + return !sinonimo.selected ? 'disabled' : 'btn-effect'; | |
52 | + } | |
53 | + | |
54 | + goNext() { | |
55 | + if (!this.sinonimos[this.currentIndex].selected) return; | |
56 | + this.currentIndex++; | |
57 | + } | |
58 | + | |
48 | 59 | continue() { |
49 | 60 | if (!this.isValid) return; |
50 | 61 | if (this.isSinonimoSelected) return; |