Fixes #3460 - Drop files here drag area not always hidden
This commit is contained in:
parent
520d834c1c
commit
cfa3f27dc4
2 changed files with 12 additions and 4 deletions
|
@ -102,11 +102,16 @@
|
|||
}
|
||||
};
|
||||
onDrop = function (e) {
|
||||
inCounter = 0
|
||||
onDragEnter(e);
|
||||
hideDropZone(dropContainer)
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
manager.processFiles(e.dataTransfer.files)
|
||||
};
|
||||
onDragEnd = function (e) {
|
||||
inCounter = 0
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
hideDropZone(dropContainer)
|
||||
};
|
||||
showDropZone = function(dropContainer) {
|
||||
$(dropContainer).trigger('html5Upload.dropZone.show')
|
||||
|
||||
|
@ -126,6 +131,7 @@
|
|||
manager.on(dropContainer, 'dragleave', onDragLeave)
|
||||
manager.on(dropContainer, 'dragover', onDragOver)
|
||||
manager.on(dropContainer, 'dragenter', onDragEnter)
|
||||
manager.on(dropContainer, 'dragend', onDragEnd)
|
||||
manager.on(dropContainer, 'drop', onDrop)
|
||||
}
|
||||
|
||||
|
|
|
@ -432,6 +432,8 @@
|
|||
y = e.clientY
|
||||
var file = dataTransfer.files[0]
|
||||
|
||||
if(!file) return;
|
||||
|
||||
// look for images
|
||||
if (file.type.match('image.*')) {
|
||||
var reader = new FileReader()
|
||||
|
@ -610,4 +612,4 @@
|
|||
return plugin.value()
|
||||
}
|
||||
|
||||
}(jQuery));
|
||||
}(jQuery));
|
||||
|
|
Loading…
Reference in a new issue