#105 Refactoring file dialog component

This commit is contained in:
mauriziovitale84
2016-06-02 09:43:34 +01:00
parent 8f1659fca1
commit 58ceebe53a
9 changed files with 31 additions and 73 deletions

View File

@@ -15,10 +15,11 @@
* limitations under the License.
*/
import { Component, ElementRef, Input } from 'angular2/core';
import { Component } from 'angular2/core';
import { FileModel } from '../models/file.model';
import { FileUploadingListComponent } from './file-uploading-list.component';
import { AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { UploadService } from '../services/upload.service';
declare let __moduleName: string;
@@ -44,29 +45,28 @@ declare let __moduleName: string;
})
export class FileUploadingDialogComponent {
@Input()
filesUploadingList: FileModel [];
isDialogActive: boolean = false;
private _isDialogActive: boolean = false;
filesUploadingList: FileModel [];
private _isDialogMinimized: boolean = false;
constructor(public el: ElementRef) {
console.log('FileUploadingDialogComponent constructor', el);
constructor(private _uploaderService: UploadService) {}
ngOnInit() {
this._uploaderService.filesUpload$.subscribe((fileList: FileModel[]) => {
this.filesUploadingList = fileList;
if (this.filesUploadingList.length > 0) {
this.isDialogActive = true;
}
});
}
/**
* Display and hide the dialog component.
*/
toggleShowDialog() {
this._isDialogActive = !this._isDialogActive;
}
/**
* Display the dialog if hidden.
*/
showDialog() {
this._isDialogActive = true;
this.isDialogActive = !this.isDialogActive;
}
/**