mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#105 Refactoring file dialog component
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user