Skip to content

Commit

Permalink
Add anchors setting and handle offset with sub-meu
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsible committed Aug 3, 2020
1 parent e85bfe9 commit 45d5600
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions client/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ const routes: Routes = [
imports: [
RouterModule.forRoot(routes, {
useHash: Boolean(history.pushState) === false,
scrollPositionRestoration: 'disabled',
scrollPositionRestoration: 'enabled',
preloadingStrategy: PreloadSelectedModulesList,
anchorScrolling: 'disabled'
anchorScrolling: 'enabled',
scrollOffset: [0, 81] // sub-menu-height
})
],
providers: [
Expand Down
8 changes: 4 additions & 4 deletions client/src/app/menu/menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<div class="dropdown-divider"></div>

<a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account">
<a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" fragment="">
<my-global-icon iconName="user" aria-hidden="true"></my-global-icon> <ng-container i18n>Account settings</ng-container>
</a>

Expand All @@ -37,13 +37,13 @@
<span class="ml-auto text-muted">{{ language }}</span>
</a>

<a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" fragment="video-settings">
<a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" fragment="video-languages-subtitles">
<my-global-icon iconName="video-lang" aria-hidden="true"></my-global-icon>
<span i18n>Videos:</span>
<span class="ml-auto text-muted">{{ videoLanguages.join(', ') }}</span>
</a>

<a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" fragment="video-settings">
<a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" fragment="video-sensitive-content-policy">
<my-global-icon class="hover-display-toggle" [ngClass]="{ 'not-displayed': user.nsfwPolicy === 'display' }" iconName="sensitive" aria-hidden="true"></my-global-icon>
<my-global-icon class="hover-display-toggle" [ngClass]="{ 'not-displayed': user.nsfwPolicy !== 'display' }" iconName="unsensitive" aria-hidden="true"></my-global-icon>
<span i18n>Sensitive:</span>
Expand All @@ -56,7 +56,7 @@
<input type="checkbox" [checked]="user.webTorrentEnabled"/><label class="ml-auto" for="switch">Toggle p2p</label>
</a>

<a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account">
<a ngbDropdownItem ngbDropdownToggle class="dropdown-item" routerLink="/my-account/settings" fragment="">
<my-global-icon iconName="more-horizontal" aria-hidden="true"></my-global-icon> <ng-container i18n>More account settings</ng-container>
</a>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<form role="form" (ngSubmit)="updateDetails()" [formGroup]="form">
<div class="form-group form-group-select">
<div class="anchor" id="video-sensitive-content-policy"></div> <!-- video-sensitive-content-policy anchor -->
<label i18n for="nsfwPolicy">Default policy on videos containing sensitive content</label>
<my-help>
<ng-template ptTemplate="customHtml">
Expand All @@ -20,6 +21,7 @@
</div>

<div class="form-group form-group-select">
<div class="anchor" id="video-languages-subtitles"></div> <!-- video-languages-subtitles anchor -->
<label i18n for="videoLanguages">Only display videos in the following languages/subtitles</label>
<my-help>
<ng-template ptTemplate="customHtml">
Expand Down

0 comments on commit 45d5600

Please sign in to comment.