_wUploadDropArea: { },
_timer: null,
_isDragging: false,
+ _isFile: false,
/**
* Initializes the RedactorPlugins.wupload plugin.
// IE and WebKit set 'Files', Firefox sets 'application/x-moz-file' for files being dragged
if (event.dataTransfer.types[0] !== 'Files' && event.dataTransfer.types[0] !== 'application/x-moz-file') {
+ this._isFile = false;
+
return;
}
+ this._isFile = true;
event.preventDefault();
if (!this._isDragging) {
* @param string containerID
*/
_revertDropArea: function(event, containerID) {
+ if (!this._isFile) {
+ return;
+ }
+
var $containerID = containerID || this.$source.wcfIdentify();
this._wUploadDropArea[$containerID].removeClass('active').text(WCF.Language.get('wcf.attachment.dragAndDrop.dropHere'));
* a delay of 100ms before the dragging will be checked again to prevent flicker.
*/
_dragLeave: function() {
+ if (!this._isDragging || !this._isFile) {
+ return;
+ }
+
if (this._timer === null) {
var self = this;
this._timer = new WCF.PeriodicalExecuter(function(pe) {
* @param object event
*/
_drop: function(event) {
+ if (!this._isFile) {
+ return;
+ }
+
event = event.originalEvent || event;
if (event.dataTransfer && event.dataTransfer.files.length == 1) {