diff --git a/ng2-components/ng2-alfresco-upload/package.json b/ng2-components/ng2-alfresco-upload/package.json index a1f72dc23d..d1e4d85bdd 100644 --- a/ng2-components/ng2-alfresco-upload/package.json +++ b/ng2-components/ng2-alfresco-upload/package.json @@ -1,7 +1,7 @@ { "name": "ng2-alfresco-upload", "description": "Alfresco Angular2 Upload Component", - "version": "0.1.32", + "version": "0.1.33", "author": "Alfresco Software, Ltd.", "scripts": { "typings": "typings install", diff --git a/ng2-components/ng2-alfresco-upload/src/directives/file-draggable.directive.ts b/ng2-components/ng2-alfresco-upload/src/directives/file-draggable.directive.ts index 33965cdd59..a1bb1d10d1 100644 --- a/ng2-components/ng2-alfresco-upload/src/directives/file-draggable.directive.ts +++ b/ng2-components/ng2-alfresco-upload/src/directives/file-draggable.directive.ts @@ -34,7 +34,7 @@ import { Directive, ElementRef, EventEmitter, Output } from 'angular2/core'; '(drop)': '_onDropFiles($event)', '(dragenter)': '_onDragEnter($event)', '(dragleave)': '_onDragLeave($event)', - '(dragover)': '_preventDefault($event)', + '(dragover)': '_onDragOver($event)', '[class.input-focus]': '_inputFocusClass' } }) @@ -118,6 +118,17 @@ export class FileDraggableDirective { this._inputFocusClass = false; } + /** + * Change the style of the drag area when a file is over the drag area. + * + * @param $event + * @private + */ + _onDragOver($event: Event): void { + this._preventDefault($event); + this._inputFocusClass = true; + } + /** * Prevent default and stop propagation of the DOM event. *