Original issue
Reveal messages won't close without the Zepto script added in template.php. Uncommenting the include fixes the behavior. What are the risks of including Zepto?
Updated Summary
The problem with the Reveals not closing (and some other js stuff to) is that Foundation 4 requires either jQuery 1.8+ or Zepto.js to work properly.
These problems are all resolved pretty easily by using the jQuery Update module and selecting jQuery 1.8 (which works perfectly with Core, CTools, Views, etc)
As far as Zepto is concerned, its a little trickier as its not really a drop-in replacement (I tried and there are a bunch of "jQuery is not defined errors" with core js) so it looks like this can be done, but not here, it should probably go in its own project.
Therefore, I think we're done here, I'm going to update the documentation to stress that this theme requires jQuery Update, can someone please? Like, really stress that this is a requirement? :)
PS - I created a sandbox project for experimenting replacing jQuery with Zepto and it's just not that simple, a bunch of jQuery plugins and other core js breaks: https://drupal.org/sandbox/alexweber/2053713
Comments
Comment #1
kevinquillen commentedFYI: I have included Zepto per the docs in the D8 branch.
Comment #2
alexweber commentedKevin, initially I think this looks like a "works as designed" because Foundation 4 requires jQuery 1.7+ and we're been trying to make that clear in the docs...
However, this comment by Ishmael suggests maybe we should fall back to Zepto by default if jQuery Update isn't installed.
Comment #3
kevinquillen commentedYeah - but Zepto doesn't work at all in IE (any version) which to me would spell a larger issue - all JS behaviors would seemingly break (from the theme, or contrib modules, etc). I think we should advise people to use jQuery Update to bump the version, or load a local jQuery file in place of Drupal core. It seems like Foundation's default behavior is to load Zepto unless the browser doesn't support it (IE) - in which case it falls back to jQuery, not the other way around. That's what this statement does:
Decision is up to be made, as long as we inform people what is happening for anyone in IE who can't see the site. But since Drupal already loads jQuery, we should probably leverage that angle first (in my opinion) for jQuery Update. That's why in the 8.x branch I just left Zepto out of the equation once I realized some of the difficulty there.
Comment #4
alexweber commentedKevin, I agree 100%... whereas nice in theory, replacing jQuery with Zepto as a fallack can actually lead to more problems because we might have to commit to supporting it. Could be a good one for the next team meeting... :)
PS - How come nobody's created a Zepto module in contribland yet?
Comment #5
chrisjlee commentedRelated: #1996720: Support Zepto.js
Comment #6
alexweber commented#2018739: Top bar broken in STARTER template.php was closed as a duplicate of this issue.
Comment #7
alexweber commentedupdated issue summary
Comment #7.0
alexweber commentedupdate issue summary
Comment #8
chrisjlee commented@alex Sounds like a better plan; but it still will mean others will continue to report bugs to us because views and modals (that depend on views) will be broken.
How do you plan on fixing that?
Comment #9
kevinquillen commentedI looked at it quite a good deal and could not satisfy four questions I posed myself:
So, while the file (currently) can be loaded in and out based on settings, it was a bit tricky to get it in correctly and get IE to work. That's when I concluded that simply having it may be more trouble than it's worth.
On top of that, jQuery Update needs to be a required module in the docs for the theme in Drupal 7, because I noticed that a lot of interface elements from contrib don't work well when the local jQuery file in the theme is used. This sets support in for some of the things in Drupal core that use things from < jQuery 1.5 that are no longer in jQuery 1.8, jQuery Update adds backwards compatibility for those deprecated methods.
Comment #10
alexweber commented@Chris, I don't think there's anything to fix, let's make jQuery Update with jQuery 1.7+ required, period. Make it bold and uppercase and all over the docs, README and project page. It's a requirement for this theme to work, if you don't like it find another theme! With jQuery Update it works perfectly, I have 2 websites going to production soon using this theme and a handful of others in dev...
@Kevin,
I honstly think that whereas it's been an interesting discussion, it's kinda getting beyond the scope of this theme. If someone wants to make a Zepto module as an alternative to jQuery Update and support it, then we can go out of our ways to support it, but I don't want us to implement this ourselves...
My $0.02!
Comment #11
alexweber commentedRelated issue: #2046631: Zepto add_js array format
Comment #12
kevinquillen commentedYep - I'd much prefer Zepto to be externally implemented so we can stick to the core guts of Foundation.
Comment #13
alexweber commentedChris, Ishmael, can we close this (and related issues) as won't fix? I've updated the documentation for 7.x-4.x stating clearly that we require jQuery Update... maybe add more info on the project page?
Documentation home: https://drupal.org/node/1948260
Specific page for jQuery Update: https://drupal.org/node/2054759
It's pretty fool-proof :)
Comment #14
chrisjlee commentedSounds good.
Comment #14.0
chrisjlee commentedadded link to sandbox project for zepto