Compare commits
3 Commits
a7fd44e3a3
...
e75fe75a5f
Author | SHA1 | Date | |
---|---|---|---|
e75fe75a5f | |||
659803dcf0 | |||
f150f9561d |
@ -44,6 +44,10 @@ const routes: Routes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const navigationLinks: NavigationLink[] = [
|
export const navigationLinks: NavigationLink[] = [
|
||||||
|
{
|
||||||
|
text: "Home",
|
||||||
|
address: "/"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: "WarpPI",
|
text: "WarpPI",
|
||||||
address: "/page/WarpPI"
|
address: "/page/WarpPI"
|
||||||
@ -83,7 +87,7 @@ export function fwlinkMatcher(url: UrlSegment[]): UrlMatchResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forRoot(routes)],
|
imports: [RouterModule.forRoot(routes, {scrollPositionRestoration: "enabled"})],
|
||||||
exports: [RouterModule]
|
exports: [RouterModule]
|
||||||
})
|
})
|
||||||
export class AppRoutingModule { }
|
export class AppRoutingModule { }
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
[href]="link.address"
|
[href]="link.address"
|
||||||
[target]="link.newtab === undefined || link.newtab === true ? '_blank' : '_self'"
|
[target]="link.newtab === undefined || link.newtab === true ? '_blank' : '_self'"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
[class.forcefocus] = "(currentDocument.onDocumentChange() | async)?.id == link.address"
|
[class.forcefocus] = "currentDocument?.id == link.address"
|
||||||
><span>{{link.text}}</span></a>
|
><span>{{link.text}}</span></a>
|
||||||
<a
|
<a
|
||||||
*ngIf="link.external !== true"
|
*ngIf="link.external !== true"
|
||||||
[routerLink]="link.address"
|
[routerLink]="link.address"
|
||||||
[target]="link.newtab === true ? '_blank' : '_self'"
|
[target]="link.newtab === true ? '_blank' : '_self'"
|
||||||
rel="noopener"
|
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>
|
><span>{{link.text}}</span></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -4,6 +4,8 @@ import { ActivatedRoute, UrlSegment } from "@angular/router";
|
|||||||
import { map } from "rxjs/operators";
|
import { map } from "rxjs/operators";
|
||||||
import { CurrentDocumentService } from "src/app/services/current-document.service";
|
import { CurrentDocumentService } from "src/app/services/current-document.service";
|
||||||
import { navigationLinks } from "src/app/app-routing.module";
|
import { navigationLinks } from "src/app/app-routing.module";
|
||||||
|
import { DocumentData } from "src/app/symbols/DocumentData";
|
||||||
|
import { Observable } from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-navbar",
|
selector: "app-navbar",
|
||||||
@ -18,8 +20,13 @@ export class NavbarComponent implements OnInit, AfterViewInit {
|
|||||||
overflowMax = false;
|
overflowMax = false;
|
||||||
@ViewChild("navlogo") navLogo: ElementRef<HTMLElement>;
|
@ViewChild("navlogo") navLogo: ElementRef<HTMLElement>;
|
||||||
@ViewChild("navbuttons") navButtons: 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() {
|
ngOnInit() {
|
||||||
}
|
}
|
||||||
|
@ -51,5 +51,5 @@ Enjoy
|
|||||||
## Videos
|
## Videos
|
||||||
|
|
||||||
<div style="margin: auto; text-align: center;">
|
<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>
|
</div>
|
Loading…
Reference in New Issue
Block a user