Skip to content

Commit

Permalink
feat(datahub): use new directive for anchor links in record header
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Feb 23, 2022
1 parent c809eb1 commit f5dd23e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,32 @@
style="left: 0; right: 0; bottom: -20px"
>
<button
(click)="scrollTo('about')"
gnUiAnchorLink="about"
gnUiAnchorLinkDisabledClass="cursor-default opacity-60"
class="uppercase font-medium tracking-wider"
translate
>
record.metadata.about
</button>
<button
(click)="scrollTo('preview')"
gnUiAnchorLink="preview"
gnUiAnchorLinkDisabledClass="cursor-default opacity-60"
class="uppercase font-medium tracking-wider"
translate
>
record.metadata.preview
</button>
<button
(click)="scrollTo('access')"
gnUiAnchorLink="access"
gnUiAnchorLinkDisabledClass="cursor-default opacity-60"
class="uppercase font-medium tracking-wider"
translate
>
record.metadata.access
</button>
<button
(click)="scrollTo('links')"
gnUiAnchorLink="links"
gnUiAnchorLinkDisabledClass="cursor-default opacity-60"
class="uppercase font-medium tracking-wider"
translate
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,4 @@ export class HeaderRecordComponent {
.pipe(first())
.subscribe((filters) => this.searchRouter.goToSearch(filters?.any))
}

scrollTo(id: string) {
document.getElementById(id).scrollIntoView({
behavior: 'smooth',
block: 'start',
})
}
}

0 comments on commit f5dd23e

Please sign in to comment.