Active li's within dropdown-submenu are not removed when a new tab is selected (my fix included)
Active li's within dropdown-submenu are not removed when a new tab is selected
Here is an example: http://jsfiddle.net/cspeak/HrXme/
How to reproduce
- Select/Click "Tab 4.5.1" (Tab 4 -> Tab 4.5 -> tab 4.5.1)
- Select/Click "Tab 4.5.2" (Tab 4 -> Tab 4.5 -> tab 4.5.2)
- Go back to the "Tab 4.5" area and you will see both "Tab 4.5.1" and "Tab 4.5.1" are active.
- Click on any other tab and both 4.5.1 and 4.5.2 are still active.
In the mean time, here is what I have implemented to get around this:
$('body').delegate('.nav.nav-tabs a', 'click', function(e) {
var $this = $(this);
var $item = $(this).parent().find('ul.dropdown-menu');
var $subCount = $item.length;
if($subCount === 0){
$this.tab("show");
$this.parents('ul').find('li.active').removeClass('active');
$this.parents('li').addClass('active');
$item.addClass('active');
}
});
Example with fix (Updated 03/22/2013): http://jsfiddle.net/HrXme/3/
UPDATE: Platform/Browser Info
OS: Fedora 17 (x64) Browsers: Chrome 25.0.1364.97 beta / Firefox 19.0
I can confirm w/ Chrome 25.0.1364.99 on Mac.
I found a bug in my original fix. Updated my current fix as well as the jsfiddle link
flyout menus aren't supported by the tab plugin. these will likely be removed in 3.0