Skip to content
Snippets Groups Projects
Commit bfaecac9 authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Fix ellipse update problems

parent befc57f3
Branches
Tags
1 merge request!139Resolve "Various improvements"
......@@ -34,10 +34,10 @@
</mat-grid-list>
<mat-divider></mat-divider>
<mat-card-content>
<mat-expansion-panel *ngFor="let content of contents">
<mat-expansion-panel *ngFor="let content of contents; index as i">
<mat-expansion-panel-header>
<mat-panel-title>
{{ content.subject }}
{{ labels[i] }}
</mat-panel-title>
<button mat-icon-button color="accent" (click)="editContent(content);$event.stopPropagation();"
class="editButton">
......
......@@ -45,6 +45,8 @@ export class ContentListComponent implements OnInit {
labelMaxLength: number;
labels: string[] = [];
constructor(private contentService: ContentService,
private roomService: RoomService,
private route: ActivatedRoute,
......@@ -68,8 +70,9 @@ export class ContentListComponent implements OnInit {
this.contents = contents;
for (let i = 0; i < this.contents.length; i++) {
if (this.contents[i].subject.length > this.labelMaxLength) {
this.contents[i].subject = this.contents[i].subject.substr(0, this.labelMaxLength) + '..';
console.log(this.contents);
this.labels[i] = this.contents[i].subject.substr(0, this.labelMaxLength) + '..';
} else {
this.labels[i] = this.contents[i].subject;
}
}
......@@ -172,6 +175,7 @@ export class ContentListComponent implements OnInit {
break;
case 'update':
this.contents[index] = this.contentCBackup;
this.contentService.updateContent(this.contents[index]).subscribe();
this.translateService.get('content.content-updated').subscribe(message => {
this.notificationService.show(message);
});
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment