diff --git a/.gitignore b/.gitignore index 0bc7c71..84d7bd1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store node_modules bower_components +yarn.lock \ No newline at end of file diff --git a/dist/jquery.cropit.js b/dist/jquery.cropit.js index d94a4b1..1a1431d 100644 --- a/dist/jquery.cropit.js +++ b/dist/jquery.cropit.js @@ -270,10 +270,6 @@ return /******/ (function(modules) { // webpackBootstrap this.zoomer = new _Zoomer2['default'](); - if (this.options.allowDragNDrop) { - _jquery2['default'].event.props.push('dataTransfer'); - } - this.bindListeners(); if (this.options.imageState && this.options.imageState.src) { @@ -335,7 +331,7 @@ return /******/ (function(modules) { // webpackBootstrap key: 'onDragOver', value: function onDragOver(e) { e.preventDefault(); - e.dataTransfer.dropEffect = 'copy'; + e.originalEvent.dataTransfer.dropEffect = 'copy'; this.$preview.toggleClass(_constants.CLASS_NAMES.DRAG_HOVERED, e.type === 'dragover'); } }, { @@ -346,7 +342,7 @@ return /******/ (function(modules) { // webpackBootstrap e.preventDefault(); e.stopPropagation(); - var files = Array.prototype.slice.call(e.dataTransfer.files, 0); + var files = Array.prototype.slice.call(e.originalEvent.dataTransfer.files, 0); files.some(function (file) { if (!file.type.match('image')) { return false; diff --git a/src/cropit.js b/src/cropit.js index a58a9ae..4132c68 100644 --- a/src/cropit.js +++ b/src/cropit.js @@ -98,10 +98,6 @@ class Cropit { this.zoomer = new Zoomer(); - if (this.options.allowDragNDrop) { - $.event.props.push('dataTransfer'); - } - this.bindListeners(); if (this.options.imageState && this.options.imageState.src) { @@ -157,7 +153,7 @@ class Cropit { onDragOver(e) { e.preventDefault(); - e.dataTransfer.dropEffect = 'copy'; + e.originalEvent.dataTransfer.dropEffect = 'copy'; this.$preview.toggleClass(CLASS_NAMES.DRAG_HOVERED, e.type === 'dragover'); } @@ -165,7 +161,7 @@ class Cropit { e.preventDefault(); e.stopPropagation(); - const files = Array.prototype.slice.call(e.dataTransfer.files, 0); + const files = Array.prototype.slice.call(e.originalEvent.dataTransfer.files, 0); files.some((file) => { if (!file.type.match('image')) { return false; }