The functionality on Drupal.quicktabs.tab() does not seem to function correctly for me on a Drupal Commons install with jQuery 1.5.2 installed (fyi, commons is using an unmodified 7.x-3.6 version of the module).
Specifically:
// Constructor for an individual tab
Drupal.quicktabs.tab = function (el) {
this.element = el;
this.tabIndex = el.myTabIndex;
var qtKey = 'qt_' + el.qt_name;
var i = 0;
for (var i = 0; i < Drupal.settings.quicktabs[qtKey].tabs.length; i++) {
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// this for loop is never used, because Drupal.settings.quicktabs[qtKey].tabs
// is an object, and .length does not appear to work on objects.
if (i == this.tabIndex) {
this.tabObj = Drupal.settings.quicktabs[qtKey].tabs[i];
this.tabKey = i;
}
}
this.tabpage_id = 'quicktabs-tabpage-' + el.qt_name + '-' + this.tabKey;
this.container = $('#quicktabs-container-' + el.qt_name);
this.tabpage = this.container.find('#' + this.tabpage_id);
}
On my install, I could not get tabs to do anything during a click event, and tracing through the stack I can see that the tabpage_id and tabpage were being set to undefined, because the tabObj and tabKey were never set correctly.
Comments
Comment #1
phillamb168 commentedAnd here's a patch.
Comment #3
phillamb168 commentedOops, my bad. Here's the patch again.
Comment #4
phillamb168 commentedComment #5
phillamb168 commentedComment #6
phillamb168 commentedComment #7
jurcello commentedWorks for me. Thank you.
Question to the maintainer: do you know why this could be an object and not an array?
Comment #8
sonicthoughts commentedworking for several months. please commit.
Comment #9
droplet commentedNote that Object.keys won't work in IE8 and below.
Comment #10
nwom commented.length is no longer used in the current dev version of the module. It appears this patch is no longer necessary.