#66 fix clickable header behaviour for special cases

This commit is contained in:
Denys Vuika
2016-05-17 16:27:05 +01:00
parent 4cf31f0d1e
commit 5319726a22
2 changed files with 7 additions and 2 deletions

View File

@@ -332,7 +332,7 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit
}
onColumnHeaderClick(column: ContentColumnModel) {
if (column) {
if (column && this._isSortableColumn(column)) {
if (this.sorting.key === column.source) {
this.sorting.direction = this.sorting.direction === 'asc' ? 'desc' : 'asc';
} else {
@@ -368,4 +368,8 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit
private _hasEntries(node: NodePaging): boolean {
return (node && node.list && node.list.entries && node.list.entries.length > 0);
}
private _isSortableColumn(column: ContentColumnModel) {
return column && column.source && !column.source.startsWith('$');
}
}