From be2f024da12e93c3b49ecf99abd3f409c9a1824a Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Mon, 10 May 2021 22:15:54 -0700 Subject: [PATCH 1/3] enable scroll position restoration and anchor scrolling --- frontend/src/app/app-routing.module.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index d9f020593..78e292c6a 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -298,7 +298,9 @@ if (browserWindowEnv && browserWindowEnv.OFFICIAL_BISQ_MARKETS) { @NgModule({ imports: [RouterModule.forRoot(routes, { - initialNavigation: 'enabled' + initialNavigation: 'enabled', + scrollPositionRestoration: 'enabled', + anchorScrolling: 'enabled' })], exports: [RouterModule] }) From ac91d814d65ad8945a41383b58aa90de0f046566 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Mon, 10 May 2021 22:16:42 -0700 Subject: [PATCH 2/3] add anchors to the block component --- frontend/src/app/components/block/block.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/block/block.component.html b/frontend/src/app/components/block/block.component.html index c76709430..b2dd5dc49 100644 --- a/frontend/src/app/components/block/block.component.html +++ b/frontend/src/app/components/block/block.component.html @@ -1,6 +1,6 @@
-
+

Genesis Block {{ blockHeight }}

@@ -80,7 +80,7 @@
-
+

From 8ccdf3973c108b846d24b76b4fe37245d005aebb Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn Date: Mon, 10 May 2021 22:18:30 -0700 Subject: [PATCH 3/3] set toggleShowDetails() to scroll into the viewport using anchors --- frontend/src/app/components/block/block.component.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/app/components/block/block.component.ts b/frontend/src/app/components/block/block.component.ts index 1d2fd844d..26a69b7eb 100644 --- a/frontend/src/app/components/block/block.component.ts +++ b/frontend/src/app/components/block/block.component.ts @@ -192,6 +192,7 @@ export class BlockComponent implements OnInit, OnDestroy { relativeTo: this.route, queryParams: { showDetails: false }, queryParamsHandling: 'merge', + fragment: 'block' }); } else { this.showDetails = true; @@ -199,6 +200,7 @@ export class BlockComponent implements OnInit, OnDestroy { relativeTo: this.route, queryParams: { showDetails: true }, queryParamsHandling: 'merge', + fragment: 'details' }); } }