Closed robertgarrigos closed 2 weeks ago
I think this is working on the latest code -- please reopen if not.
Still, I'm getting this error in the web console with jQuery 3 and the latest code.
With jQuery 3 the cross in the image always appears in the top-left corner of the image. Only when I switch to jquery 1 the cross appears where you left it the last time.
I think I've found the problem here: https://blog.jquery.com/2015/07/13/jquery-3-0-and-jquery-compat-3-0-alpha-versions-released/
I've fixed this problem by changing this code:
setTimeout(function() {
$img.one('load', function(){
focalPointSetIndicator($indicator, $(this), $field);
}).each(function() {
if (this.complete) {
$(this).load();
}
});
}, 0);
to this:
setTimeout(function () {
$img.one('load', function () {
focalPointSetIndicator($indicator, $(this), $field);
}).each(function () {
if (this.complete) {
$(this).trigger('load'); // Trigger the load event manually if the image is already loaded
}
});
}, 0);
Done a PR which addresses this problem.
@robertgarrigos Is this working for you with the latest version? At some point the same change you suggest must have been added -- it doesn't seem like your PR changes anything substantial.
@laryn yes, latest version works with jQuery 3. Thanks
This module is not working with JQuery 3. It does with JQuery 1. Editing a node with an image field which uses focal point triggers this error: