Don't render full input witness if user does not press "show all"
This commit is contained in:
@@ -114,22 +114,33 @@
|
||||
<td i18n="transactions-list.witness">Witness</td>
|
||||
<td style="text-align: left;">
|
||||
<ng-container *ngFor="let witness of vin.witness; index as i">
|
||||
<input type="checkbox" [id]="'tx' + vindex + 'witness' + i" style="display: none;">
|
||||
<p class="witness-item" [class.accordioned]="witness.length > 1000">
|
||||
<ng-template [ngIf]="witness" [ngIfElse]="emptyWitnessItem">
|
||||
<p class="witness-item">
|
||||
@if (witness.length > 1000) {
|
||||
@if (!showFullWitness[vindex][i]) {
|
||||
{{ witness | slice:0:1000 }}
|
||||
} @else {
|
||||
{{ witness }}
|
||||
}
|
||||
} @else if (witness) {
|
||||
{{ witness }}
|
||||
</ng-template>
|
||||
<ng-template #emptyWitnessItem>
|
||||
} @else {
|
||||
<empty>
|
||||
</ng-template>
|
||||
}
|
||||
</p>
|
||||
<div class="witness-toggle" *ngIf="witness.length > 1000">
|
||||
<span class="ellipsis">...</span>
|
||||
<label [for]="'tx' + vindex + 'witness' + i" class="btn btn-sm btn-primary mt-2">
|
||||
<span class="show-all" i18n="show-all">Show all</span>
|
||||
<span class="show-less" i18n="show-less">Show less</span>
|
||||
</label>
|
||||
</div>
|
||||
@if (witness.length > 1000) {
|
||||
<div style="display: flex;">
|
||||
@if (!showFullWitness[vindex][i]) {
|
||||
<span>...</span>
|
||||
}
|
||||
<label class="btn btn-sm btn-primary mt-2" (click)="toggleShowFullWitness(vindex, i)" style="margin-left: auto;">
|
||||
@if (!showFullWitness[vindex][i]) {
|
||||
<span i18n="show-all">Show all</span>
|
||||
} @else {
|
||||
<span i18n="show-less">Show less</span>
|
||||
}
|
||||
</label>
|
||||
</div>
|
||||
}
|
||||
</ng-container>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user