Slight modifications: options & link.href fixes

I think these modification might work better for compatibility:

Based on control.tabs.js, version 1.6.0:

  1. It seems that the options constructor argument wasn't being used. Here's a fix to use them. (I wanted this for the linkSelector option.)

43: beforeChange: options.beforeChange || Prototype.emptyFunction,

44: afterChange: options.afterChange || Prototype.emptyFunction,

45: linkSelector: options.linkSelector || 'li a',

46: activeClassName: options.activeClassName || 'active',

47: defaultTab: options.defaultTab || 'first',

48: autoLinkExternal: options.autoLinkExternal || true

  1. For non links, the "link.href" on line 57 don't reveal the attribute. Here's the change:

57: ).findAll(function(link){return (/^#/).exec(link.getAttribute('href').replace(window.location.href.split('#')[0],''));});

Otherwise, it works fabulous. Great work! K. Lo Shih

Posted May 3rd, 2007 at 11:56am by kloshih

Login or Register to Post