Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
overlay.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
2 Dec 2009 at 08:02 UTC
Updated:
6 Jan 2010 at 23:10 UTC
Jump to comment: Most recent file
I was loading a node edit page in the new overlays (awesome, btw!) and noticed the fieldsets were collapsed and not in vertical tabs. My JS console was giving me the error:
href is undefined in overlay-child.js
if (href.indexOf('http') > 0 || href.indexOf('https') > 0) {\n"Did a little investigation and the link that this is failing on is the 'Skip to main content' link inside the overlay which has a class of overlay-processed. I simply added a check for .not(.overlay-processed) and it worked just fine and made sense to skip links already processed by overlay.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 648630-overlay-js-D7.patch | 886 bytes | dave reid |
| #1 | 648630-before.png | 170.5 KB | dave reid |
| #1 | 648630-after.png | 170.01 KB | dave reid |
Comments
Comment #1
dave reidPatch attached for review along with screenshots of before/after. Look at inside the overlay at the node fieldsets that should be in vertical tabs.
Comment #2
markus_petrux commentedFWIW, I had this issue in the Modal Frame API queue, related to jQuery Tabs, and I fixed it by adding the child behavior on top of all existing behaviors in the global Drupal object. That way, the content of the child document is already visible when other behaviors are executed.
Related issue in the Modal Frame API queue: #608472: jQuery Tabs in Modal Frame do not work because the child document is not visible until the child Drupal behavior is executed
That particular patch can be found here: patch
I think that was the best solution to this problem, because the same issue could also affect other modules, not just the Vertical Tabs behavior.
In my case, the problem was that jQuery Tabs was unable to get the size of certain elements because they were not visible at the time the behavior was executed.
I think this could be related.
Comment #3
sunerrrrrr...... this is duplicating what $.once() already does. If this has an effect, then it's just by coincidence.
errrrrrrrrrrrrrrrrrrr... oh my. $.once() takes the function to invoke with $.each() as second argument. So just kill ").each(" here.
This review is powered by Dreditor.
Comment #4
robloachAs Sun mentioned above, this should do it:
......... Looking at this, it seems like the Overlay will execute on every a tag on the page. If you're on a page with 1000 a tags, then this function will have to add overlay-processed to each one of those elements. Would it be a better idea to use
$('a.overlay-include').once('overlay', ...instead so that we don't have that front-end performance hit? Instead of applying the Overlay to everything except X, shouldn't we instead simply apply the Overlay to Y and not worry about the exceptions/exclusions?Comment #5
sunomg... why don't we use the observer pattern as implemented by quicksketch in Google Analyics module?
http://drupalcode.org/viewvc/drupal/contributions/modules/google_analyti...
Comment #6
gábor hojtsy@Rob Loach: how do you tell from PHP which links should be included in the overlay and how do you tell these for JS generated markup, stuff that was built based on JSON requests, etc?
@sun: tracking document clicks and looking at the element clicked does indeed seem to be a good idea.
Comment #7
robloachYou're right, Gabor, links could be generated anywhere (PHP or JavaScript) without being considered by the Overlay's PHP layer. If we apply the observer approach here, it might be a good solution around it.
Comment #8
casey commentedThis is fixed per #174 in #615130: Overlay locks up the browser and consumes 100% of CPU for certain browsers/graphics cards/operating systems.
Anyone who can still reproduce it is free to reopen.