Skip to content

Commit

Permalink
workaround for #8 : button to open in new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Schmidt committed Jul 14, 2018
1 parent ac5659e commit fef18e7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/app/slotting/overview-component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@
color: white;
}
}

.slotlist-new-tab {
transition: all 0.2s ease;
&:hover {
background-color: #8F1167;
border-color: #660066 !important;
color: white;
}
}
9 changes: 7 additions & 2 deletions src/app/slotting/overview.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@
<div class="switch_label">Kompakt</div>
</label>

<app-slotting *ngFor="let match of slottingService.matches" [match]="match"></app-slotting>

<app-slotting *ngFor="let match of slottingService.matches" [match]="match"></app-slotting>

<div *ngIf="isInIframe()" style="float: right">
<a class="nodebb btn btn-default slotlist-new-tab" (click)="openInNewTab()" title="open in new tab">
<i class="fa fa-external-link"></i> +
</a>
</div>
<div>
<a class="nodebb btn btn-default slotlist-add-button" (click)="createMatch()">
<a class="nodebb btn btn-default slotlist-add-button" (click)="createMatch()" title="create new match">
<i class="fa fa-sitemap"></i> +
</a>
</div>
8 changes: 8 additions & 0 deletions src/app/slotting/overview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ export class OverviewComponent implements OnInit {
this.slottingService.bootbox('Das ging schief :(');
}
}

public isInIframe(): boolean {
return window !== window.parent;
}

public openInNewTab(): void {
window.open(window.location.href, '_blank');
}
}

0 comments on commit fef18e7

Please sign in to comment.