Skip to content
This repository has been archived by the owner on Jun 24, 2019. It is now read-only.

Commit

Permalink
fix: only react on images and files
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Kruse committed Jun 14, 2017
1 parent f469507 commit 1cd6b1d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/assets/javascripts/auto/image_upload.js
Expand Up @@ -10,6 +10,15 @@ function ImageUpload(input) {
var elements = $();

var enter = function(e) {
var dt = e.dataTransfer;
if(!dt) {
dt = e.originalEvent.dataTransfer;
}

if(dt.types.length === 0 || (!dt.types[0].match(/image\//) && dt.types[0] != 'Files')) {
return;
}

window.clearTimeout(tm);
tm = null;
zone.addClass('dragging');
Expand Down

0 comments on commit 1cd6b1d

Please sign in to comment.