From 9331e07c6e101bf6203df1c6f6d71a3015dc9063 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Mon, 23 May 2016 15:33:04 +0100 Subject: [PATCH] Fixed column translation problem --- .../ng2-alfresco-documentlist/package.json | 2 +- .../src/components/content-column-list.ts | 14 ++++++++++++++ .../src/components/content-column.ts | 9 +++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ng2-components/ng2-alfresco-documentlist/package.json b/ng2-components/ng2-alfresco-documentlist/package.json index 733aa1d894..6e01f4aba6 100644 --- a/ng2-components/ng2-alfresco-documentlist/package.json +++ b/ng2-components/ng2-alfresco-documentlist/package.json @@ -1,7 +1,7 @@ { "name": "ng2-alfresco-documentlist", "description": "Alfresco Angular2 Document List Component", - "version": "0.1.4", + "version": "0.1.5", "author": "Alfresco Software, Ltd.", "scripts": { "typings": "typings install", diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts index 42c745caf3..f7e511dd86 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts @@ -38,4 +38,18 @@ export class ContentColumnList { this.documentList.columns.push(column); } } + + /** + * Update the title with the new value + * @param column Column definition model. + */ + updateColumn(column: ContentColumnModel): void { + if (this.documentList && column) { + this.documentList.columns.forEach((tmpColumn) => { + if (tmpColumn.source === column.source) { + tmpColumn.title = column.title; + } + }); + } + } } diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-column.ts index 93a186875f..84824b33d0 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column.ts @@ -58,4 +58,13 @@ export class ContentColumn implements OnInit { this.list.registerColumn(model); } } + + ngOnChanges(change) { + let model = new ContentColumnModel(); + model.title = this.title; + model.source = this.source; + if (this.list) { + this.list.updateColumn(model); + } + } }