Display selected file name when re-selected after clear

Refs #812
This commit is contained in:
Will Abson
2016-11-17 11:42:13 +00:00
committed by Mario Romano
parent f64ef77d41
commit 1c2b2fa40a
3 changed files with 11 additions and 13 deletions

View File

@@ -35,7 +35,6 @@ export class AttachWidget extends WidgetComponent implements OnInit {
selectedFolderSiteName: string;
selectedFolderAccountId: string;
fileName: string;
hasFile: boolean;
selectedFolderNodes: [ExternalContent];
selectedFile: ExternalContent;
@@ -54,10 +53,6 @@ export class AttachWidget extends WidgetComponent implements OnInit {
ngOnInit() {
if (this.field) {
if (this.field.value) {
this.hasFile = true;
}
let params = this.field.params;
if (params &&
@@ -149,7 +144,10 @@ export class AttachWidget extends WidgetComponent implements OnInit {
reset() {
this.field.value = null;
this.field.json.value = null;
this.hasFile = false;
}
hasFile(): boolean {
return this.field && this.field.value;
}
}