From 6cc91acb6e637ebae8b569fb05ec9433a067566e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 17 Sep 2014 12:21:48 +0200 Subject: [PATCH] Safari fix breaks IE support, fixed --- .../js/3rdParty/redactor/plugins/wupload.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js index c6fd016ef0..daaeeacbd7 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js @@ -50,9 +50,20 @@ RedactorPlugins.wupload = { // IE and WebKit set 'Files', Firefox sets 'application/x-moz-file' for files being dragged // and Safari just provides 'Files' along with a huge list of other stuff - if (event.dataTransfer.types[0] !== 'application/x-moz-file' && event.dataTransfer.types.indexOf('Files') === -1) { - this._isFile = false; - + this._isFile = false; + if (event.dataTransfer.types[0] === 'application/x-moz-file') { + this._isFile = true; + } + else { + for (var $i = 0; $i < event.dataTransfer.types.length; $i++) { + if (event.dataTransfer.types[$i] === 'Files') { + this._isFile = true; + break; + } + } + } + + if (!this._isFile) { return; } -- 2.20.1