diff --git a/jquery_update.module b/jquery_update.module index 3b62d97..0fc4820 100644 --- a/jquery_update.module +++ b/jquery_update.module @@ -95,6 +95,14 @@ function jquery_update_library_alter(&$javascript, $module) { } } + // If the ajax version is set then that one always win. + if (!empty($_POST['ajax_page_state']['jquery_version'])) { + $ajax_version = $_POST['ajax_page_state']['jquery_version']; + if (in_array($ajax_version, array('1.5', '1.6', '1.7', '1.8', '1.9', '1.10'))) { + $version = $ajax_version; + } + } + // Always add a new jquery_version array to ajaxPageState. // This is what we used to determine which version to use // for any ajax callback. @@ -236,13 +244,6 @@ function jquery_update_settings_form() { * The version of jQuery to use. */ function jquery_update_jquery_replace(&$javascript, $cdn, $path, $min, $version) { - // If the ajax version is set then that one always win. - if (!empty($_POST['ajax_page_state']['jquery_version'])) { - $ajax_version = $_POST['ajax_page_state']['jquery_version']; - if (in_array($ajax_version, array('1.5', '1.6', '1.7', '1.8', '1.9', '1.10'))) { - $version = $ajax_version; - } - } // Make sure to use the latest version in given branch. $trueversion = NULL;