Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jCrop Error #7

Closed
natedin opened this issue Jun 20, 2015 · 7 comments
Closed

jCrop Error #7

natedin opened this issue Jun 20, 2015 · 7 comments
Labels

Comments

@natedin
Copy link

natedin commented Jun 20, 2015

Hi, I've installed the latest version of Image+ (2.3.2) on MODX 2.3.3 (clean install) and I'm receiving the following error when trying to crop image using Image+

Uncaught TypeError: this.$image.Jcrop is not a function
Ext.extend.initJcrop @ imageplus.jquery.imagecrop.js?v=233pl:77
(anonymous function) @ ext-base.js:21

File: imageplus.jquery.imagecrop.js?v=233pl:77

This is running on a local machine, using WAMP 2.4, PHP 5.4.12, pThumb 2.3.3

Thanks

@Jako
Copy link
Owner

Jako commented Jun 20, 2015

That means that $image does not exist. You could try to increase the defer value from 10 to something higher in line 55 of assets/components/imageplus/mgr/js/imageplus.jquery.imagecrop.js

Looking for a better solution to be sure that the element exists.

@Jako Jako added the bug label Jun 20, 2015
@natedin
Copy link
Author

natedin commented Jun 22, 2015

Thanks for the info, I've managed to get it working! It seems there was a conflict with the Asset Manager extra (whoops! forgot it was installed). Would it be possible to make Image+ run in a no-conflict mode to prevent this?

@Jako
Copy link
Owner

Jako commented Jun 22, 2015

Seems that $image has to be put into a closure then.

@jenswittmann
Copy link

There is also a Problem with MarkdownEditor Plugin, same error as above. It also use Jcrop.

@Jako
Copy link
Owner

Jako commented Jun 29, 2015

Will be fixed in the next release.

@Jako
Copy link
Owner

Jako commented Jul 4, 2015

Can't do much here. That are stupid jQuery and jQuery Plugin version issues. Asset Manager uses jQuery in another version and jCrop in the same version but with different file paths and filenames (jcrop.js vs. jquery.jcrop.min.js). MarkdownEditor uses a combined dependencies.js with another jQuery version inside that kills all jQuery scripts registered before.

It is more the fault of the MODX regClientScript system that does not allow dependencies and version checks.

Jako referenced this issue Jul 5, 2015
- Run jQuery in noConflict mode.
@Jako
Copy link
Owner

Jako commented Jul 5, 2015

Solved with the hint of @theboxer by jQuery.noConflict

@Jako Jako closed this as completed Jul 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants