From: Alexander Ebert Date: Wed, 17 Sep 2014 10:21:48 +0000 (+0200) Subject: Safari fix breaks IE support, fixed X-Git-Tag: 2.1.0_Alpha_1~344^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6cc91acb6e637ebae8b569fb05ec9433a067566e;p=GitHub%2FWoltLab%2FWCF.git Safari fix breaks IE support, fixed --- 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; }