Fix misaligned score table header by flex box use
parent
694edc7afe
commit
4fb2326ef6
|
@ -1,65 +1,24 @@
|
||||||
.scoreboard-table {
|
.scoreboard-table {
|
||||||
height: 60vh;
|
width: 1115px;
|
||||||
width: fit-content;
|
margin: auto;
|
||||||
border: 1px solid #dadada;
|
height: 68vh;
|
||||||
overflow-x: auto;
|
overflow-x: hidden;
|
||||||
margin: 56px auto auto;
|
overflow-y: auto;
|
||||||
}
|
box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
|
||||||
|
border-bottom: 1px solid #dadada;
|
||||||
:host /deep/ table.mat-table > thead {
|
|
||||||
position: absolute;
|
|
||||||
width: 977px;
|
|
||||||
display: inherit;
|
|
||||||
margin-left: -1px;
|
|
||||||
margin-top: -57px;
|
|
||||||
border: 1px solid #dadada;
|
|
||||||
}
|
|
||||||
|
|
||||||
:host /deep/ table.mat-table > tbody {
|
|
||||||
margin-top: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.in-table-btn {
|
|
||||||
position: absolute;
|
|
||||||
margin-top: -5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:host /deep/ table.mat-table > tbody {
|
|
||||||
margin-top: 60px;
|
|
||||||
display: block;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mat-column-name {
|
.mat-column-name {
|
||||||
width: 200px;
|
flex: 0 0 220px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mat-column-fraction {
|
.mat-column-fraction {
|
||||||
width: 90px;
|
flex: 0 0 90px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mat-column-kill, .mat-column-friendlyFire, .mat-column-revive, .mat-column-flagTouch, .mat-column-vehicleLight,
|
.mat-column-kill, .mat-column-friendlyFire, .mat-column-revive, .mat-column-flagTouch, .mat-column-vehicleLight,
|
||||||
.mat-column-vehicleHeavy, .mat-column-vehicleAir, .mat-column-death, .mat-column-respawn, .mat-column-interact {
|
.mat-column-vehicleHeavy, .mat-column-vehicleAir, .mat-column-death, .mat-column-respawn, .mat-column-interact {
|
||||||
width: 67px;
|
flex: 0 0 80px;
|
||||||
text-indent: 9px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-column-vehicleLight mat-icon.mat-icon {
|
|
||||||
width: 28px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-column-vehicleHeavy mat-icon.mat-icon {
|
|
||||||
width: 33px;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mat-column-vehicleAir mat-icon.mat-icon {
|
|
||||||
width: 35px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
td.mat-cell:last-child, td.mat-footer-cell:last-child, th.mat-header-cell:last-child {
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:host /deep/ .mat-table .mat-icon {
|
:host /deep/ .mat-table .mat-icon {
|
||||||
|
|
|
@ -1,47 +1,46 @@
|
||||||
<div class="fade-in scoreboard-table">
|
<div class="fade-in scoreboard-table">
|
||||||
|
|
||||||
<table mat-table matSort
|
<mat-table matSort
|
||||||
[dataSource]="sortedRows"
|
[dataSource]="sortedRows"
|
||||||
matSortActive="{{tableHead[2].prop}}" matSortDirection="asc" matSortDisableClear
|
matSortActive="{{tableHead[2].prop}}" matSortDirection="asc" matSortDisableClear
|
||||||
(matSortChange)="sortScoreboardData($event)"
|
(matSortChange)="sortScoreboardData($event)"
|
||||||
class="mat-elevation-z8">
|
class="mat-elevation-z8">
|
||||||
|
|
||||||
<ng-container matColumnDef="{{tableHead[0].prop}}">
|
<ng-container matColumnDef="{{tableHead[0].prop}}">
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</th>
|
<mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</mat-header-cell>
|
||||||
<td mat-cell *matCellDef="let element"
|
<mat-cell *matCellDef="let element"
|
||||||
[style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
|
[style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
|
||||||
{{element.name}}
|
{{element.name}}
|
||||||
</td>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="{{tableHead[1].prop}}">
|
<ng-container matColumnDef="{{tableHead[1].prop}}">
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</th>
|
<mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</mat-header-cell>
|
||||||
<td mat-cell *matCellDef="let element">{{element.fraction === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</td>
|
<mat-cell *matCellDef="let element">{{element.fraction === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}">
|
<ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}">
|
||||||
<th mat-header-cell *matHeaderCellDef mat-sort-header="{{column.prop}}">
|
<mat-header-cell *matHeaderCellDef mat-sort-header="{{column.prop}}">
|
||||||
<mat-icon svgIcon="{{column.prop}}"
|
<mat-icon svgIcon="{{column.prop}}"
|
||||||
matTooltip="{{column.head | translate}}">
|
matTooltip="{{column.head | translate}}">
|
||||||
</mat-icon>
|
</mat-icon>
|
||||||
</th>
|
</mat-header-cell>
|
||||||
<td mat-cell *matCellDef="let element">{{element[column.prop]}}</td>
|
<mat-cell *matCellDef="let element">{{element[column.prop]}}</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="interact">
|
<ng-container matColumnDef="interact">
|
||||||
<th mat-header-cell *matHeaderCellDef></th>
|
<mat-header-cell *matHeaderCellDef></mat-header-cell>
|
||||||
<td mat-cell *matCellDef="let element">
|
<mat-cell *matCellDef="let element">
|
||||||
<button mat-icon-button
|
<button mat-icon-button
|
||||||
matTooltip="{{ 'stats.scoreboard.button.detail' | translate:{name: element.name} }}"
|
matTooltip="{{ 'stats.scoreboard.button.detail' | translate:{name: element.name} }}"
|
||||||
(click)="selectPlayerDetail(1, isSteamUUID(element['steamUUID']) ?
|
(click)="selectPlayerDetail(1, isSteamUUID(element['steamUUID']) ?
|
||||||
element['steamUUID'] : element['name'])">
|
element['steamUUID'] : element['name'])">
|
||||||
<mat-icon svgIcon="stats-detail">
|
<mat-icon svgIcon="stats-detail"></mat-icon>
|
||||||
</mat-icon>
|
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||||
</table>
|
</mat-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue