tabs don't currently work in iframes

geoff_eagles - January 7, 2009 - 14:52
Project:Javascript Tools
Version:5.x-1.2
Component:Tabs
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Your code worked fine within iframes until 5.x-0.6, then you introduced drupal behaviors and started using Drupal.settings for all the tab options and I'm afraid that broke it.
Essentially what happens is that when the tabs.js code runs within an iframe it can't actually see Drupal.settings.
There is an easy fix which I'm hoping you might consider for future releases. You need to test whether Drupal.settings is valid - if it's not, try its parent. In the case of my code where I have an iframe with tabs launched from an iframe I need a further test on the parent's parent e.g

var dset = Drupal.settings;
if (!dset)
dset = parent.Drupal.settings;
if (!dset)
dset = parent.parent.Drupal.settings;

then you'll use
fxFade: dset.tabs.fade,

etc. etc

maybe there's a more elegant way of doing it? Any chance something similar could be shoved in next time you release?

 
 

Drupal is a registered trademark of Dries Buytaert.