Open adantart opened 7 years ago
yea i'm getting the following exception in my console:
jQuery.Deferred exception: _jquery2.default.event.props is undefined init@http://localhost:8000/js/jquery.cropit.js:274:10 Cropit@http://localhost:8000/js/jquery.cropit.js:194:6 init/<@http://localhost:8000/js/jquery.cropit.js:102:21 each@http://localhost:8000/js/jquery-3.2.1.min.js:2:2713 each@http://localhost:8000/js/jquery-3.2.1.min.js:2:1001 init@http://localhost:8000/js/jquery.cropit.js:96:13 _jquery2.default.fn.cropit@http://localhost:8000/js/jquery.cropit.js:147:13 @http://localhost:8000/js/cropit.js:2:2 j@http://localhost:8000/js/jquery-3.2.1.min.js:2:29997 g/</k<@http://localhost:8000/js/jquery-3.2.1.min.js:2:30313
I am getting the same issue
cannot read property 'push' of undefined
It works fine If You can comment out.
// if (this.options.allowDragNDrop) { // _jquery2['default'].event.props.push('dataTransfer'); // }
This disables drag and drop
why developer didn't update cropit for jquery v3?
In jQuery 3 add event like this
jQuery.event.addProp('dataTransfer')
Also you can solve it by adding allowDragNDrop: false
in your cropit call.
@Fahri5567 where should we add this line jQuery.event.addProp('dataTransfer')
?
@kpmdevgr I change this.
if (this.options.allowDragNDrop) {
$.event.props.push('dataTransfer');
}
to
if (this.options.allowDragNDrop) {
if ($.event.props.push) { //if can push
$.event.props.push('dataTransfer');
}
else {
$.event.addProp('dataTransfer');
}
}
and build.
But i have problem build cropit with webpack.
the problem Error: Cannot find module './Zoomer'
, because in the file name not Zoomer.js but is zoomer.js.
I change import Zoomer from './Zoomer';
to import Zoomer from './zoomer';
.
and build.
Is this script still maintained? jQuery 3 compatibility is a must. Does any one created a side project?
@angelogeminiani i am using it in two web projects with jquery 3, and the only thing i had to change was the drag and drop to be disabled!
I have had the same issue.. But disabling drag and drop works.
$('.image-editor').cropit({
allowDragNDrop: false
});
It does not load the image and returns a push function error/warning notification