Posted by micheas on September 9, 2012 at 5:41pm
4 followers
Jump to:
| Project: | ZURB Foundation |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | ishmael-sanchez |
| Status: | closed (fixed) |
Issue Summary
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
#1
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).
#2
.on is a jquery 1.7 function that is used in various zurbfoundation fuctions.
#3
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)
#4
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.
#5
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.
#6
So I just committed this code
<?phpfunction 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.
#7
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.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.
#9
A good resource for using newer versions of jQuery http://drupal.org/node/1058168