Simplify highscore code and adjust font in table head

pull/34/head
HardiReady 2018-05-05 09:14:49 +02:00
parent e54168ec22
commit d6703f715d
5 changed files with 17 additions and 15 deletions

View File

@ -60,7 +60,7 @@ export class CampaignPlayerDetailComponent implements OnInit {
this.campaignPlayer = campaignPlayer; this.campaignPlayer = campaignPlayer;
this.graphData = [ this.graphData = [
{ key: 'kill', label: 'Kills', }, { key: 'kill', label: 'Abschüsse', },
{ key: 'friendlyFire', label: 'Friendly Fire', }, { key: 'friendlyFire', label: 'Friendly Fire', },
{ key: 'death', label: 'Tode', }, { key: 'death', label: 'Tode', },
{ key: 'respawn', label: 'Respawn', }, { key: 'respawn', label: 'Respawn', },

View File

@ -57,6 +57,10 @@ ngx-datatable {
background-color: #f7f7f7; background-color: #f7f7f7;
} }
:host /deep/ .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell {
margin: auto;
}
/* Table Scrollbar BEGIN */ /* Table Scrollbar BEGIN */
:host /deep/ .ngx-datatable.scroll-vertical .datatable-body::-webkit-scrollbar { :host /deep/ .ngx-datatable.scroll-vertical .datatable-body::-webkit-scrollbar {

View File

@ -15,7 +15,7 @@
</span> </span>
</div> </div>
<div *ngFor="let attributeMap of playerAttributeDisplayNames.slice(2, playerAttributeDisplayNames.length)"> <div *ngFor="let attributeMap of playerAttributeDisplayNames">
<ngx-datatable <ngx-datatable
[rows]="players[attributeMap.prop]" [rows]="players[attributeMap.prop]"
[messages]="emptyMessage" [messages]="emptyMessage"

View File

@ -28,7 +28,7 @@ export class StatisticHighScoreComponent implements OnInit {
playersStored = {}; playersStored = {};
playerAttributeDisplayNames = PlayerUtils.attributeDisplayNames; playerAttributeDisplayNames = PlayerUtils.attributeDisplayNames.slice(2, PlayerUtils.attributeDisplayNames.length);
cellHeight = 40; cellHeight = 40;
@ -36,7 +36,7 @@ export class StatisticHighScoreComponent implements OnInit {
nameColWidth = 210; nameColWidth = 210;
valueColWidth = 50; valueColWidth = 55;
emptyMessage = {emptyMessage: 'Keine Einträge'}; emptyMessage = {emptyMessage: 'Keine Einträge'};
@ -87,17 +87,11 @@ export class StatisticHighScoreComponent implements OnInit {
if (!this.searchTerm.value || this.searchTerm.value === '') { if (!this.searchTerm.value || this.searchTerm.value === '') {
this.players = this.playersStored; this.players = this.playersStored;
} else { } else {
this.players = { this.players = {};
kill: this.filterPlayerAttribute('kill'), for (let i = 0; i < this.playerAttributeDisplayNames.length; i++) {
friendlyFire: this.filterPlayerAttribute('friendlyFire'), const attributeProperty = this.playerAttributeDisplayNames[i].prop;
vehicleLight: this.filterPlayerAttribute('vehicleLight'), this.players[attributeProperty] = this.filterPlayerAttribute(attributeProperty);
vehicleHeavy: this.filterPlayerAttribute('vehicleLight'), }
vehicleAir: this.filterPlayerAttribute('vehicleLight'),
death: this.filterPlayerAttribute('death'),
respawn: this.filterPlayerAttribute('respawn'),
revive: this.filterPlayerAttribute('revive'),
flagTouch: this.filterPlayerAttribute('flagTouch')
};
} }
} }

View File

@ -43,6 +43,10 @@ ngx-datatable {
background-color: #f7f7f7; background-color: #f7f7f7;
} }
:host /deep/ .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell {
margin: auto;
}
/* Table Scrollbar BEGIN */ /* Table Scrollbar BEGIN */
:host /deep/ .ngx-datatable.scroll-vertical .datatable-body::-webkit-scrollbar { :host /deep/ .ngx-datatable.scroll-vertical .datatable-body::-webkit-scrollbar {
width: 12px; width: 12px;