Skip to content

Commit

Permalink
Add the vote shuffle to front end
Browse files Browse the repository at this point in the history
  • Loading branch information
Khazius committed Jun 14, 2018
1 parent 4182f3f commit f6fc496
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/dashboard/vote/vote.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@
<h4 class="title">Vote for Block Producers! </h4>
<h5 class="subtitle mt-0">You can vote for up to 30</h5>
</div>
<div class="col-lg-4 col-md-6 text-right">
<div class="col-lg-3 col-md-6 text-right">
<mat-form-field class="searchbar">
<input type="text" matInput placeholder="Search..."
(input)="dt.filterGlobal($event.target.value, 'contains')">
<fa-icon matSuffix [icon]="['far', 'search']" size="lg"></fa-icon>
</mat-form-field>
</div>
<div class="col-lg text-right">
<button (click)="shuffleBps()" class="btn btn-info-outline"
style="margin-top: 12px; margin-right: 25px">
SHUFFLE
</button>
</div>
<div class="col-lg text-right">
<button (click)="processVotes()" class="btn btn-info-outline"
style="margin-top: 12px; margin-right: 25px" [disabled]="nVotes > 30">
Expand Down
4 changes: 4 additions & 0 deletions src/app/dashboard/vote/vote.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export class VoteComponent implements OnInit, AfterViewInit {
this.voteService.listProducers();
}

shuffleBps() {
this.voteService.randomizeList();
}

processVotes() {
this.selectedBPs = [];
this.voteService.bps.forEach((bp) => {
Expand Down

0 comments on commit f6fc496

Please sign in to comment.