fix stray space, automatically show more outputs if <5 remaining
This commit is contained in:
parent
6cd1f9e870
commit
01a727a344
@ -153,7 +153,7 @@
|
|||||||
<ng-template #showMoreInputsLabel>
|
<ng-template #showMoreInputsLabel>
|
||||||
<span i18n="show-more">Show more</span>
|
<span i18n="show-more">Show more</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
({{ tx.vin.length - getVinLimit(tx) }} <span i18n="inputs-remaining">remaining</span> )
|
({{ tx.vin.length - getVinLimit(tx) }} <span i18n="inputs-remaining">remaining</span>)
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -270,7 +270,7 @@
|
|||||||
<ng-template #showMoreOutputsLabel>
|
<ng-template #showMoreOutputsLabel>
|
||||||
<span i18n="show-more">Show more</span>
|
<span i18n="show-more">Show more</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
({{ tx.vout.length - getVoutLimit(tx) }} <span i18n="outputs-remaining">remaining</span> )
|
({{ tx.vout.length - getVoutLimit(tx) }} <span i18n="outputs-remaining">remaining</span>)
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -230,19 +230,29 @@ export class TransactionsListComponent implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getVinLimit(tx: Transaction, next = false): number {
|
getVinLimit(tx: Transaction, next = false): number {
|
||||||
|
let limit;
|
||||||
if ((tx['@vinLimit'] || 0) > this.inputRowLimit) {
|
if ((tx['@vinLimit'] || 0) > this.inputRowLimit) {
|
||||||
return Math.min(tx['@vinLimit'] + (next ? this.showMoreIncrement : 0), tx.vin.length);
|
limit = Math.min(tx['@vinLimit'] + (next ? this.showMoreIncrement : 0), tx.vin.length);
|
||||||
} else {
|
} else {
|
||||||
return Math.min((next ? this.showMoreIncrement : this.inputRowLimit), tx.vin.length);
|
limit = Math.min((next ? this.showMoreIncrement : this.inputRowLimit), tx.vin.length);
|
||||||
}
|
}
|
||||||
|
if (tx.vin.length - limit <= 5) {
|
||||||
|
limit = tx.vin.length;
|
||||||
|
}
|
||||||
|
return limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
getVoutLimit(tx: Transaction, next = false): number {
|
getVoutLimit(tx: Transaction, next = false): number {
|
||||||
|
let limit;
|
||||||
if ((tx['@voutLimit'] || 0) > this.outputRowLimit) {
|
if ((tx['@voutLimit'] || 0) > this.outputRowLimit) {
|
||||||
return Math.min(tx['@voutLimit'] + (next ? this.showMoreIncrement : 0), tx.vout.length);
|
limit = Math.min(tx['@voutLimit'] + (next ? this.showMoreIncrement : 0), tx.vout.length);
|
||||||
} else {
|
} else {
|
||||||
return Math.min((next ? this.showMoreIncrement : this.outputRowLimit), tx.vout.length);
|
limit = Math.min((next ? this.showMoreIncrement : this.outputRowLimit), tx.vout.length);
|
||||||
}
|
}
|
||||||
|
if (tx.vout.length - limit <= 5) {
|
||||||
|
limit = tx.vout.length;
|
||||||
|
}
|
||||||
|
return limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user