jQuery version detection is broken
Closed this issue · 2 comments
codener commented
First: Thanks for the SudoSlider. We're using it for years and are quite happy with it.
I was wondering why SudoSlider would refuse to use CSS for transitions. When I dug into the code, I found that SudoSlider set usecss
to false because it believed the jQuery version was too low.
Unfortunately, the minJQueryVersion
function is lying. It will only return true
if all digits are greater than the required minimum, which is wrong when it comes to versions numbers.
Instead, the function should return early as soon as any digit is greater than required:
// The minVersion is specified in an array, like [1, 8, 0] for 1.8.0
function minJQueryVersion(minVersion) {
var version = $.fn.jquery.split(".");
var length = version.length
for (var i = 0; i < length; i++) {
if (+version[i] < +minVersion[i]) { return FALSE; }
if (+version[i] > +minVersion[i]) { return TRUE; }
}
return TRUE;
}
Best regards
webbiesdk commented
Nicely spotted 👍
codener commented
Ok THIS was fast 😄
Thanks!