Safari fix breaks IE support, fixed
authorAlexander Ebert <ebert@woltlab.com>
Wed, 17 Sep 2014 10:21:48 +0000 (12:21 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 17 Sep 2014 10:21:48 +0000 (12:21 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wupload.js

index c6fd016ef0bc50809c0c9f68fb0b9151ed8dd721..daaeeacbd79a641a736091366f0fcc8260ede913 100644 (file)
@@ -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;
                }