}
// 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') {
+ // 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;
return;
event = event.originalEvent || event;
- if (event.dataTransfer && event.dataTransfer.files.length == 1) {
+ if (event.dataTransfer && event.dataTransfer.files.length) {
event.preventDefault();
// reset overlay
var $containerID = this.$source.wcfIdentify();
this._revertDropArea(undefined, $containerID);
- WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'upload_' + $containerID, { file: event.dataTransfer.files[0] });
+ for (var $i = 0; $i < event.dataTransfer.files.length; $i++) {
+ var $file = event.dataTransfer.files[$i];
+ if ($file.type) {
+ WCF.System.Event.fireEvent('com.woltlab.wcf.redactor', 'upload_' + $containerID, { file: $file });
+ }
+ }
}
},