Compare commits
3 Commits
a7fd44e3a3
...
e75fe75a5f
Author | SHA1 | Date | |
---|---|---|---|
e75fe75a5f | |||
659803dcf0 | |||
f150f9561d |
@ -44,6 +44,10 @@ const routes: Routes = [
|
||||
];
|
||||
|
||||
export const navigationLinks: NavigationLink[] = [
|
||||
{
|
||||
text: "Home",
|
||||
address: "/"
|
||||
},
|
||||
{
|
||||
text: "WarpPI",
|
||||
address: "/page/WarpPI"
|
||||
@ -83,7 +87,7 @@ export function fwlinkMatcher(url: UrlSegment[]): UrlMatchResult {
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes)],
|
||||
imports: [RouterModule.forRoot(routes, {scrollPositionRestoration: "enabled"})],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
|
@ -7,14 +7,14 @@
|
||||
[href]="link.address"
|
||||
[target]="link.newtab === undefined || link.newtab === true ? '_blank' : '_self'"
|
||||
rel="noopener"
|
||||
[class.forcefocus] = "(currentDocument.onDocumentChange() | async)?.id == link.address"
|
||||
[class.forcefocus] = "currentDocument?.id == link.address"
|
||||
><span>{{link.text}}</span></a>
|
||||
<a
|
||||
*ngIf="link.external !== true"
|
||||
[routerLink]="link.address"
|
||||
[target]="link.newtab === true ? '_blank' : '_self'"
|
||||
rel="noopener"
|
||||
[class.force-focus] = "'/page/' + (currentDocument.onDocumentChange() | async)?.id == link.address"
|
||||
[class.force-focus] = "'/page/' + currentDocument?.id == link.address || (currentDocument?.id == 'index' && link.address == '/')"
|
||||
><span>{{link.text}}</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -4,6 +4,8 @@ import { ActivatedRoute, UrlSegment } from "@angular/router";
|
||||
import { map } from "rxjs/operators";
|
||||
import { CurrentDocumentService } from "src/app/services/current-document.service";
|
||||
import { navigationLinks } from "src/app/app-routing.module";
|
||||
import { DocumentData } from "src/app/symbols/DocumentData";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: "app-navbar",
|
||||
@ -18,8 +20,13 @@ export class NavbarComponent implements OnInit, AfterViewInit {
|
||||
overflowMax = false;
|
||||
@ViewChild("navlogo") navLogo: ElementRef<HTMLElement>;
|
||||
@ViewChild("navbuttons") navButtons: ElementRef<HTMLElement>;
|
||||
currentDocument: DocumentData;
|
||||
|
||||
constructor(private elRef: ElementRef<HTMLElement>, public currentDocument: CurrentDocumentService) { }
|
||||
constructor(private elRef: ElementRef<HTMLElement>, currentDocument: CurrentDocumentService) {
|
||||
currentDocument.onDocumentChange().subscribe(docData => {
|
||||
this.currentDocument = docData;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
@ -51,5 +51,5 @@ Enjoy
|
||||
## Videos
|
||||
|
||||
<div style="margin: auto; text-align: center;">
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/4rcnu8j1Xqk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/4rcnu8j1Xqk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style="max-width: 100%;"></iframe>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user