From 75b3bc62494b702f8101c6dacee4c432f921e69d Mon Sep 17 00:00:00 2001 From: natsee Date: Sun, 17 Dec 2023 19:15:23 +0100 Subject: [PATCH] Expand toggle for RBF history view --- .../rbf-timeline/rbf-timeline.component.html | 17 ++++++++++++++--- .../rbf-timeline/rbf-timeline.component.scss | 6 ++++++ .../rbf-timeline/rbf-timeline.component.ts | 6 ++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/components/rbf-timeline/rbf-timeline.component.html b/frontend/src/app/components/rbf-timeline/rbf-timeline.component.html index a2012d45f..8a750e624 100644 --- a/frontend/src/app/components/rbf-timeline/rbf-timeline.component.html +++ b/frontend/src/app/components/rbf-timeline/rbf-timeline.component.html @@ -1,7 +1,7 @@
-
-
+
+
@@ -13,7 +13,7 @@
-
+
+
+ + + + +
@@ -72,3 +81,5 @@ [isConnector]="hoverConnector" > -->
+ +{{ x }} remaining \ No newline at end of file diff --git a/frontend/src/app/components/rbf-timeline/rbf-timeline.component.scss b/frontend/src/app/components/rbf-timeline/rbf-timeline.component.scss index be7aef2d6..8afc3f026 100644 --- a/frontend/src/app/components/rbf-timeline/rbf-timeline.component.scss +++ b/frontend/src/app/components/rbf-timeline/rbf-timeline.component.scss @@ -34,6 +34,12 @@ &::-webkit-scrollbar { display: none; } + + .toggle-wrapper { + width: 100%; + text-align: center; + margin: 1.25em 0 0; + } } .intervals, .nodes { diff --git a/frontend/src/app/components/rbf-timeline/rbf-timeline.component.ts b/frontend/src/app/components/rbf-timeline/rbf-timeline.component.ts index 474da7326..687a7dbfd 100644 --- a/frontend/src/app/components/rbf-timeline/rbf-timeline.component.ts +++ b/frontend/src/app/components/rbf-timeline/rbf-timeline.component.ts @@ -25,7 +25,9 @@ function isTimelineCell(val: RbfTree | TimelineCell): boolean { export class RbfTimelineComponent implements OnInit, OnChanges { @Input() replacements: RbfTree; @Input() txid: string; + @Input() rowLimit: number = 5; // If explicitly set to 0, all timelines rows will be displayed by default rows: TimelineCell[][] = []; + timelineExpanded: boolean = this.rowLimit === 0; hoverInfo: RbfTree | null = null; tooltipPosition = null; @@ -191,6 +193,10 @@ export class RbfTimelineComponent implements OnInit, OnChanges { return rows; } + toggleTimeline(expand: boolean): void { + this.timelineExpanded = expand; + } + scrollToSelected() { const node = document.getElementById('node-' + this.txid); if (node) {