mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 03:53:02 +00:00
added default value for onBeforeUpload property
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
import {of as observableOf, Observable } from 'rxjs';
|
|
||||||
import {
|
import {
|
||||||
ChangeDetectionStrategy,
|
ChangeDetectionStrategy,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
@@ -11,6 +9,7 @@ import {
|
|||||||
ViewEncapsulation,
|
ViewEncapsulation,
|
||||||
} from '@angular/core'
|
} from '@angular/core'
|
||||||
|
|
||||||
|
import { of as observableOf } from 'rxjs';
|
||||||
import { FileUploader } from 'ng2-file-upload';
|
import { FileUploader } from 'ng2-file-upload';
|
||||||
import { uniqueId } from 'lodash';
|
import { uniqueId } from 'lodash';
|
||||||
import { ScrollToConfigOptions, ScrollToService } from '@nicky-lenaers/ngx-scroll-to';
|
import { ScrollToConfigOptions, ScrollToService } from '@nicky-lenaers/ngx-scroll-to';
|
||||||
@@ -115,6 +114,9 @@ export class UploaderComponent {
|
|||||||
this.uploader.onAfterAddingFile = ((item) => {
|
this.uploader.onAfterAddingFile = ((item) => {
|
||||||
item.withCredentials = false;
|
item.withCredentials = false;
|
||||||
});
|
});
|
||||||
|
if (isUndefined(this.onBeforeUpload)) {
|
||||||
|
this.onBeforeUpload = () => {return};
|
||||||
|
}
|
||||||
this.uploader.onBeforeUploadItem = () => {
|
this.uploader.onBeforeUploadItem = () => {
|
||||||
this.onBeforeUpload();
|
this.onBeforeUpload();
|
||||||
this.isOverDocumentDropZone = observableOf(false);
|
this.isOverDocumentDropZone = observableOf(false);
|
||||||
|
Reference in New Issue
Block a user