show preview in news with fix table size
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
[sortOrder]="sortOrder"
|
||||
[searchControl]="searchControl"
|
||||
extraColumnId="snippet"
|
||||
extraColumnHeader="Fundstelle"
|
||||
extraColumnHeader="Inhalt"
|
||||
[extraColumnTemplate]="snippetTpl"
|
||||
(sortChange)="onSortChange($event)"
|
||||
(pageChange)="onPage($event)">
|
||||
|
||||
@@ -44,12 +44,12 @@ export class NewsComponent implements OnInit {
|
||||
|
||||
readonly searchControl = new FormControl('', { nonNullable: true });
|
||||
|
||||
get displayedColumns(): string[] {
|
||||
if (this.isSearching) {
|
||||
return ['maintitle', 'snippet', 'relevance', 'date'];
|
||||
}
|
||||
return ['maintitle', 'relevance', 'date'];
|
||||
}
|
||||
readonly displayedColumns: string[] = [
|
||||
'maintitle',
|
||||
'snippet',
|
||||
'relevance',
|
||||
'date',
|
||||
];
|
||||
|
||||
articles: NewsArticle[] = [];
|
||||
total = 0;
|
||||
@@ -58,10 +58,6 @@ export class NewsComponent implements OnInit {
|
||||
currentPage = 1;
|
||||
sortOrder: SortOrder = DEFAULT_SORT_ORDER;
|
||||
|
||||
get isSearching(): boolean {
|
||||
return this.searchControl.value.trim().length > 0;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.route.queryParamMap
|
||||
.pipe(takeUntilDestroyed(this.destroyRef))
|
||||
|
||||
@@ -58,12 +58,25 @@
|
||||
table {
|
||||
width: 100%;
|
||||
min-width: 600px;
|
||||
table-layout: fixed;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0 10px;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
::ng-deep .mat-column-maintitle {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
::ng-deep .mat-column-relevance {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
::ng-deep .mat-column-date {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.article-title {
|
||||
display: inline-block;
|
||||
max-width: 520px;
|
||||
@@ -187,6 +200,7 @@ table {
|
||||
color: var(--sg-text);
|
||||
border-bottom-color: var(--sg-border);
|
||||
font-size: 13px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
mat-paginator {
|
||||
|
||||
Reference in New Issue
Block a user