rvera / image-picker

Image Picker is a simple jQuery plugin that transforms a select element into a more user friendly graphical interface.
http://rvera.github.com/image-picker
Other
907 stars 216 forks source link

Bug with JQuery 3.0.0 #78

Closed blevesque closed 7 years ago

blevesque commented 8 years ago

Hi, I want to inform you that your lib doesn't work with JQuery 3.0.0 :-) We have to work with JQuery 2.2.4

UnderlineWords commented 8 years ago

+1... Will there be an update for JQuery 3.0? Thanks

rvera commented 8 years ago

Ouch, do you know what changed in JQuery 3? What error are you getting?

UnderlineWords commented 8 years ago

It doesn't give me any error message on the browser. But it doesn't work.

It maybe useful for jQuery changes https://jquery.com/upgrade-guide/3.0/

UnderlineWords commented 8 years ago

Hmm, it works technically when i submit the form but select style doesn't change. So i can't see the my selected items when i click on images.

rvera commented 8 years ago

Interesting, maybe a method got deprecated. I'll take a look later in the week, thanks a lot for the heads up.

rdennis commented 7 years ago

The issue seems to be with both_array_are_equal. jQuery::not is always returning true. It seems you just need to replace it with a quick array comparison.

gotshoo commented 7 years ago

I replaced

both_array_are_equal = function(a, b) { return jQuery(a).not(b).length === 0 && jQuery(b).not(a).length === 0; }; with

both_array_are_equal = function(a, b) { var difference = []; $.grep(a, function (el) { if ($.inArray(el, b) == -1) difference.push(el); }); if (difference.length === 0) { var $i = 0; while ($i < a.length) { if (a[$i] !== b[$i]) { return false; } $i++; } return true; } else { return false; } };

to get this to work with Jquery 3.0

sadgamer commented 7 years ago

hi your code is not working gotshoo

rdennis commented 7 years ago

I have a pull request #81 to add jQuery 3 support. Until the request is merged you can use my branch.

rvera commented 7 years ago

Excellent work! Merged 🐈