Skip to content

Commit 6325da0

Browse files
mlopezFCjavier-godoy
authored andcommitted
fix: use router for calculating selected menu item class
1 parent 65ddbed commit 6325da0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/resources/META-INF/resources/frontend/fc-applayout/fc-fusion-layout.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export class FusionLayout extends LitElement {
4545
@property({type: Boolean})
4646
fixed = false;
4747

48+
@property({type: Router, attribute: false})
49+
router: Router | null = null;
4850

4951
constructor() {
5052
super();
@@ -165,7 +167,7 @@ export class FusionLayout extends LitElement {
165167
}
166168

167169
private currentLocationClass(route: string): string {
168-
return ""; /*Router.urlForPath(route) === Router.location.pathname?"current":"other";*/
170+
return !route.startsWith("http://") && !route.startsWith("https://") && this.router!=null && this.router!.urlForPath(route) === this.router!.location.pathname?"current":"other";
169171
}
170172

171173
private buildMenu(){

0 commit comments

Comments
 (0)