Skip to content
This repository was archived by the owner on Jul 3, 2019. It is now read-only.

Commit e0fdda9

Browse files
committed
updated screenshot
1 parent 8898efc commit e0fdda9

File tree

5 files changed

+22
-4
lines changed

5 files changed

+22
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/lore/component/element/sidebar.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ <h2>Actors {{ (currentLoreActors$ | async)?.length }}</h2>
2828
mat-stroked-button
2929
*ngFor="let actor of currentLoreActors$ | async"
3030
(click)="select($event, actor)"
31+
[matTooltip]="(actorService.accumulatorOf(actor) | async)?.accumulator.name.value + ' (' + actor?._states?.length + ')'"
3132
[ngStyle]="{ backgroundColor: (actorService.accumulatorOf(actor) | async)?.accumulator.color.value }"
3233
>
3334
<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+
}})
3538
</button>
3639
</div>
3740
<div class="tools grid">

src/app/lore/component/element/sidebar.component.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
:host {
22
button {
33
transition: background-color 0.1s;
4+
text-overflow: ellipsis;
5+
overflow: hidden;
6+
white-space: nowrap;
47
}
58
.spacer {
69
flex: 1 1 auto;
@@ -26,7 +29,7 @@
2629

2730
.grid {
2831
display: grid;
29-
grid-template-columns: 1fr 1fr;
32+
grid-template-columns: 1fr;
3033
grid-gap: 1rem;
3134
margin: 1rem;
3235
}

src/app/lore/lore.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { ConfirmComponent } from './component/dialog/confirm.component';
3636
import { ExportComponent } from './component/dialog/export.component';
3737
import { ToolbarComponent } from './component/element/toolbar.component';
3838
import { LoreComponent } from './lore.component';
39+
import { TruncatePipe } from '@app/pipe/truncate.pipe';
3940

4041
@NgModule({
4142
declarations: [
@@ -62,7 +63,8 @@ import { LoreComponent } from './lore.component';
6263
ToolbarComponent,
6364
MathRoundPipe,
6465
ToStringPipe,
65-
MathAbsPipe
66+
MathAbsPipe,
67+
TruncatePipe
6668
],
6769
imports: [
6870
LoreStoreModule,

src/app/pipe/truncate.pipe.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
}

0 commit comments

Comments
 (0)