Skip to content

Commit c8318a1

Browse files
authored
Merge pull request #146 from GSA/bugfix/144_faq_sidenav
Ticket 144: Fixing the side navbar in FAQ
2 parents b4db57a + 060ce8c commit c8318a1

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/app/help/faq/faq.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ <h1>Frequently Asked Questions</h1>
8282
<div class="col-md-9 nopadding">
8383
<div class="faq-right-content">
8484
<div class="search-title" *ngFor="let section of faq;">
85-
<h2 id="{{section.title}}">{{section.name}}</h2>
85+
<h2 class="search-title-header" id="{{section.title}}">{{section.name}}</h2>
8686
<div class="panel-group" *ngIf="section.children">
8787
<div id="{{section.id}}" class="accordion panel panel-default search-content" *ngFor="let element of section.children; let i = index">
8888
<div class="accordion-item panel-heading">

src/app/help/faq/faq.component.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ height: 45px;
3939
text-align: center;
4040
}
4141

42+
.search-title-header {
43+
scroll-margin-top: 3em;
44+
}
45+
4246
.no-padding {
4347
padding: 0px !important;
4448
margin: 0px !important;
@@ -50,7 +54,7 @@ text-align: center;
5054
}
5155

5256
.panel-group {
53-
margin-bottom: 40px;
57+
margin-bottom: 3em;
5458
}
5559

5660
.panel-heading button{

src/app/help/faq/faq.component.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@ export class FaqComponent extends BaseComponent implements OnInit {
7979
* window scroll to selected ID
8080
* @param ID
8181
*/
82-
scroll(ID) {
82+
scroll(ID: string) {
8383
const element = document.getElementById(ID);
84-
$('html, body').animate({
85-
scrollTop: $(element).offset().top - 80
86-
});
84+
if (element) {
85+
element.scrollIntoView({
86+
behavior: 'smooth'
87+
})
88+
}
8789
}
8890

8991
/**

0 commit comments

Comments
 (0)