From 394205be49fab4ccf52b4c83c2df172a39b5696e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 12 Dec 2016 00:17:18 +0100 Subject: [PATCH] Link fixed --- .../components/dashboard-link.directive.ts | 16 ++++++++++------ .../app/shell/pages/app/left-menu.component.scss | 1 - src/Squidex/app/theme/_bootstrap.scss | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Squidex/app/shared/components/dashboard-link.directive.ts b/src/Squidex/app/shared/components/dashboard-link.directive.ts index 6d3a527b6..b9727d6fa 100644 --- a/src/Squidex/app/shared/components/dashboard-link.directive.ts +++ b/src/Squidex/app/shared/components/dashboard-link.directive.ts @@ -15,18 +15,22 @@ import { AppsStoreService } from './../services/apps-store.service'; }) export class DashboardLinkDirective implements Ng2.OnInit, Ng2.OnDestroy { private appSubscription: any; - private appName: string; + private url: string; constructor( private readonly appsStore: AppsStoreService, - private readonly router: Ng2Router.Router + private readonly router: Ng2Router.Router, + private readonly element: Ng2.ElementRef, + private readonly renderer: Ng2.Renderer ) { } public ngOnInit() { this.appSubscription = this.appsStore.selectedApp.subscribe(app => { - this.appName = app.name; + this.url = this.router.createUrlTree(['app', app.name]).toString(); + + this.renderer.setElementAttribute(this.element.nativeElement, 'href', this.url); }); } @@ -36,8 +40,8 @@ export class DashboardLinkDirective implements Ng2.OnInit, Ng2.OnDestroy { @Ng2.HostListener('click') public onClick() { - if (this.appName) { - this.router.navigate(['app', this.appName]); - } + this.router.navigateByUrl(this.url); + + return false; } } \ No newline at end of file diff --git a/src/Squidex/app/shell/pages/app/left-menu.component.scss b/src/Squidex/app/shell/pages/app/left-menu.component.scss index d34d1f630..963011e2b 100644 --- a/src/Squidex/app/shell/pages/app/left-menu.component.scss +++ b/src/Squidex/app/shell/pages/app/left-menu.component.scss @@ -45,7 +45,6 @@ &-item { & { color: $color-dark-foreground; - cursor: pointer; text-align: center; } diff --git a/src/Squidex/app/theme/_bootstrap.scss b/src/Squidex/app/theme/_bootstrap.scss index 0f85b6031..a794702a9 100644 --- a/src/Squidex/app/theme/_bootstrap.scss +++ b/src/Squidex/app/theme/_bootstrap.scss @@ -270,6 +270,7 @@ & { @include border-radius(0); background: $color-dark-selected; + pointer-events: none; } &:hover {