Skip to content
Snippets Groups Projects
Commit bac9eb44 authored by Florent Poittevin's avatar Florent Poittevin
Browse files

fix: breadcrumb by disabling current page link

parent 2b400ef3
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<li *ngFor="let breadcrumb of breadcrumbsObs | async" <li *ngFor="let breadcrumb of breadcrumbsObs | async"
class="breadcrumb-item" class="breadcrumb-item"
> >
<a (click)="navigate(breadcrumb.url)">{{breadcrumb.label | translate}}</a> <a [class.current]="isCurrent(breadcrumb.url)"
(click)="navigate(breadcrumb.url)"
>{{breadcrumb.label | translate}}</a>
</li> </li>
</ol> </ol>
...@@ -18,3 +18,18 @@ li + li:before { ...@@ -18,3 +18,18 @@ li + li:before {
color: $dark-grey; color: $dark-grey;
content: "/\00a0"; content: "/\00a0";
} }
a {
&.current {
text-decoration: none;
cursor: initial;
&:hover {
color: $primary-color;
}
&:hover:before {
visibility: hidden;
}
}
}
...@@ -115,6 +115,13 @@ export class SharedBreadcrumbPresentational extends SharedAbstractPresentational ...@@ -115,6 +115,13 @@ export class SharedBreadcrumbPresentational extends SharedAbstractPresentational
} }
navigate(url: string): void { navigate(url: string): void {
if (this.isCurrent(url)) {
return;
}
this._navigateBS.next(url); this._navigateBS.next(url);
} }
isCurrent(url: string): boolean {
return this.router.url + "/" === url;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment