From 477746c361270a6155cdd96e8422f221e6acb5ba Mon Sep 17 00:00:00 2001 From: Max Bechdel Date: Wed, 13 Nov 2013 11:55:19 -0700 Subject: [PATCH] Fixed jquery loader bug for jquery versions 1.10 or higher. It was parsing versions 1.10.x as 1.1 which made it think that the current version was less the required version 1.7.x. --- source/js/Core/Embed/Embed.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/js/Core/Embed/Embed.js b/source/js/Core/Embed/Embed.js index 5427591..bf3d6f0 100644 --- a/source/js/Core/Embed/Embed.js +++ b/source/js/Core/Embed/Embed.js @@ -231,13 +231,15 @@ function createStoryJS(c, src) { ready.has_jquery = jQuery; ready.has_jquery = true; if (ready.has_jquery) { - var jquery_version = parseFloat(jQuery.fn.jquery); - if (jquery_version < parseFloat(jquery_version_required) ) { - //console.log("NOT THE REQUIRED VERSION OF JQUERY, LOADING THE REQUIRED VERSION"); - //console.log("YOU HAVE VERSION " + jQuery.fn.jquery + ", JQUERY VERSION " + jquery_version_required + " OR ABOVE NEEDED"); - ready.jquery = false; - } else { - ready.jquery = true; + var jquery_version_array = jQuery.fn.jquery.split("."); + var jquery_version_required_array = jquery_version_required.split("."); + ready.jquery = true; + for (i = 0; i < 2; i++) { + if (parseFloat(jquery_version_array[i]) < parseFloat(jquery_version_required_array[i])) { + //console.log("NOT THE REQUIRED VERSION OF JQUERY, LOADING THE REQUIRED VERSION"); + //console.log("YOU HAVE VERSION " + jQuery.fn.jquery + ", JQUERY VERSION " + jquery_version_required + " OR ABOVE NEEDED"); + ready.jquery = false; + } } } } catch(err) {