angular-file-upload
angular-file-upload copied to clipboard
onDragLeave is not working
on Chrome on Windows when you drag the file from the operating system to the drop zone, the style changes to the drop zone are applied. However, if you do not drop, and leave the drop zone, the style does not go away.
When will you be releasing #719?
please merge the fix for this issue. I'm waiting for it.
I was able to fix this issue by tweaking the following line 1813:
if (event.currentTarget === this.element[0]) return;
becomes
if (event.currentTarget !== this.element[0]) return;
My understanding is that this check is required depending on whether the element the nv-file-drop directive is applied to is the same element as the overlay. So to avoid the previous 'flicker' issue and also fix the Drag Leave bug this should do the trick. Unless I'm mistaken. Either way if you are using the same element as the drop zone commenting this line out should also do the trick.
you can make something like this, in your controller where you use FileUploader, before make instance of it you can type
FileUploader.FileDrop.prototype.onDragLeave = function onDragLeave(event) {
if (event.currentTarget !== this.element[0]) {return;} // some fix code here
this._preventAndStop(event);
angular.forEach(this.uploader._directives.over, this._removeOverClass, this);
};
you can make something like this, in your controller where you use FileUploader, before make instance of it you can type
FileUploader.FileDrop.prototype.onDragLeave = function onDragLeave(event) { if (event.currentTarget !== this.element[0]) {return;} // some fix code here this._preventAndStop(event); angular.forEach(this.uploader._directives.over, this._removeOverClass, this); };
This won't work in my case - uploader goes mad when you drag the element over and when you drop it - just opens the image in browser.
you can make something like this, in your controller where you use FileUploader, before make instance of it you can type
FileUploader.FileDrop.prototype.onDragLeave = function onDragLeave(event) { if (event.currentTarget !== this.element[0]) {return;} // some fix code here this._preventAndStop(event); angular.forEach(this.uploader._directives.over, this._removeOverClass, this); };
This won't work in my case - uploader goes mad when you drag the element over and when you drop it - just opens the image in browser.
ты походу промахиваешься и не попадаешь в область драг и дропа, если у тебя открывается картинка)))) сделай при перетягивании файла на область, чтобы она подсвечивалась) вот на, попробуй тут ======> https://jsfiddle.net/TimurKatemirov/dg9te60s/27/ специально для тебя.