Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules
bower_components
yarn.lock

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably use unix line ending (add a newline)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much Mlunoe: now cropit works with jquery 3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@klucznik did all the hard work though

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
yarn.lock
yarn.lock

8 changes: 2 additions & 6 deletions dist/jquery.cropit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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');
}
}, {
Expand All @@ -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;
Expand Down
8 changes: 2 additions & 6 deletions src/cropit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -157,15 +153,15 @@ 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');
}

onDrop(e) {
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; }

Expand Down