Browse Source

Link fixed

pull/1/head
Sebastian 10 years ago
parent
commit
394205be49
  1. 16
      src/Squidex/app/shared/components/dashboard-link.directive.ts
  2. 1
      src/Squidex/app/shell/pages/app/left-menu.component.scss
  3. 1
      src/Squidex/app/theme/_bootstrap.scss

16
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;
}
}

1
src/Squidex/app/shell/pages/app/left-menu.component.scss

@ -45,7 +45,6 @@
&-item {
& {
color: $color-dark-foreground;
cursor: pointer;
text-align: center;
}

1
src/Squidex/app/theme/_bootstrap.scss

@ -270,6 +270,7 @@
& {
@include border-radius(0);
background: $color-dark-selected;
pointer-events: none;
}
&:hover {

Loading…
Cancel
Save