Skip to content

Commit

Permalink
PRC-713: changes to make fragment code work
Browse files Browse the repository at this point in the history
  • Loading branch information
severinbeauvais committed Oct 2, 2018
1 parent 2c314d1 commit c780182
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="top-container" *ngIf="application">
<div class="top-container">
<div class="container">
<div class="title-container">
<div class="title-container__title">
Expand Down Expand Up @@ -26,7 +26,7 @@ <h1><span class="text-muted">Crown land File: {{application['clFile']}} &nbsp;&r
</div>
</div>

<div class="bottom-container" *ngIf="application">
<div class="bottom-container">
<div class="container">
<form class="mb-3" #applicationForm="ngForm">
<fieldset>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ export class ApplicationAddEditComponent implements OnInit, OnDestroy {
router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
const url = router.parseUrl(router.url);
if (url.fragment) {
if (url && url.fragment) {
// ensure element exists
const element = document.querySelector('#' + url.fragment);
const element = document.getElementById(url.fragment);
if (element) {
document.getElementById(url.fragment).scrollIntoView();
element.scrollIntoView();
}
}
}
Expand Down

0 comments on commit c780182

Please sign in to comment.