You need to install jquery update and configure it to use jquery 1.7 instead of jquery 1.5.

I don't know if we can make a theme depend on a module.

Comments

ishmael-sanchez’s picture

What happens if you don't? I haven't been using 1.5 and didn't notice any issue, but who knows what I might have missed. I'm strongly against making any theme depend on a module.

If need be we could always implement hook_js_alter or hook_library (I think that's what jquery update does).

micheas’s picture

.on is a jquery 1.7 function that is used in various zurbfoundation fuctions.

micheas’s picture

Furthermore Jquery 1.7 is the first jquery version that supports html5 So it is more or less the version of jquery that I would use for all new sites. (unless I used jquery 1.8)

ishmael-sanchez’s picture

Component: Documentation » Code
Status: Active » Needs work

Ok I will take a look at the hook_library function when I get a sec or feel free to assign this issue to yourself.

micheas’s picture

Based on the state of jquery_update I am more inclined to put it in documentation for the time being.

Also, it seems that if you don't use parts of the javascript functions it works without jquery_update.

ishmael-sanchez’s picture

Version: » 7.x-1.x-dev
Assigned: Unassigned » ishmael-sanchez
Status: Needs work » Fixed

So I just committed this code

function zurb_foundation_js_alter(&$js) {
  if (!module_exists('jquery_update')) {
    // Swap out jQuery to use an updated version of the library.
    $js['misc/jquery.js']['data'] = drupal_get_path('theme', 'zurb_foundation') . '/js/jquery.js';
    $js['misc/jquery.js']['version'] = '1.8.2';
  } 
}

it checks for the jquery_update module and if it does exist it does it's thing. Otherwise it uses the jQuery version from the framework. If a sub-theme needed to it could always override this function if they needed to use older versions. Don't know if this is the most optimized but it's working.

micheas’s picture

The only issue that I know of is that ctools ajax will not work if you are using that on any pages that are themed with foundation. (views and ajax being a big one.)

The workaround of course is to actually install jquery_update.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ishmael-sanchez’s picture

A good resource for using newer versions of jQuery http://drupal.org/node/1058168