This repository was archived by the owner on Jul 3, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +22
-4
lines changed Expand file tree Collapse file tree 5 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,13 @@ <h2>Actors {{ (currentLoreActors$ | async)?.length }}</h2>
28
28
mat-stroked-button
29
29
*ngFor ="let actor of currentLoreActors$ | async "
30
30
(click) ="select($event, actor) "
31
+ [matTooltip] ="(actorService.accumulatorOf(actor) | async)?.accumulator.name.value + ' (' + actor?._states?.length + ')' "
31
32
[ngStyle] ="{ backgroundColor: (actorService.accumulatorOf(actor) | async)?.accumulator.color.value } "
32
33
>
33
34
< fa-icon [icon] ="maleIcon " [size] ="maleIconSize "> </ fa-icon >
34
- {{ (actorService.accumulatorOf(actor) | async)?.accumulator.name.value }} ({{ actor?._states?.length }})
35
+ {{ (actorService.accumulatorOf(actor) | async)?.accumulator.name.value }} ({{
36
+ actor?._states?.length
37
+ }})
35
38
</ button >
36
39
</ div >
37
40
< div class ="tools grid ">
Original file line number Diff line number Diff line change 1
1
:host {
2
2
button {
3
3
transition : background-color 0.1s ;
4
+ text-overflow : ellipsis ;
5
+ overflow : hidden ;
6
+ white-space : nowrap ;
4
7
}
5
8
.spacer {
6
9
flex : 1 1 auto ;
26
29
27
30
.grid {
28
31
display : grid ;
29
- grid-template-columns : 1fr 1 fr ;
32
+ grid-template-columns : 1fr ;
30
33
grid-gap : 1rem ;
31
34
margin : 1rem ;
32
35
}
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import { ConfirmComponent } from './component/dialog/confirm.component';
36
36
import { ExportComponent } from './component/dialog/export.component' ;
37
37
import { ToolbarComponent } from './component/element/toolbar.component' ;
38
38
import { LoreComponent } from './lore.component' ;
39
+ import { TruncatePipe } from '@app/pipe/truncate.pipe' ;
39
40
40
41
@NgModule ( {
41
42
declarations : [
@@ -62,7 +63,8 @@ import { LoreComponent } from './lore.component';
62
63
ToolbarComponent ,
63
64
MathRoundPipe ,
64
65
ToStringPipe ,
65
- MathAbsPipe
66
+ MathAbsPipe ,
67
+ TruncatePipe
66
68
] ,
67
69
imports : [
68
70
LoreStoreModule ,
Original file line number Diff line number Diff line change
1
+ import { Pipe , PipeTransform } from '@angular/core' ;
2
+
3
+ @Pipe ( { name : 'truncate' } )
4
+ export class TruncatePipe implements PipeTransform {
5
+ public transform ( value : string , args : string [ ] ) : string {
6
+ const limit = args . length > 0 ? parseInt ( args [ 0 ] , 10 ) : 20 ;
7
+ const trail = args . length > 1 ? args [ 1 ] : '...' ;
8
+ return value . length > limit ? value . substring ( 0 , limit - 3 ) + trail : value ;
9
+ }
10
+ }
You can’t perform that action at this time.
0 commit comments