Skip to content

Commit

Permalink
tab: Fix error when no dropdown is used with tabs
Browse files Browse the repository at this point in the history
If there is no dropdown being used as a tab self.dropdown is null. This
results in an error when attempting to test/set the active class on the null
dropdown variable.

This bug was introduced in commit "Removed `classList` dependency " 7acaaac...
  • Loading branch information
soda0289 committed Jan 21, 2016
1 parent 798be68 commit 35622a0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/tab-native.js
Expand Up @@ -68,10 +68,12 @@
self.addClass(next.parentNode,'active');

// handle dropdown menu "active" class name
if ( !(isDropDown.test(self.tab.parentNode.parentNode.className)) ) {
if (/active/.test(self.dropdown.className)) self.removeClass(self.dropdown,'active');
} else {
if (!/active/.test(self.dropdown.className)) self.addClass(self.dropdown,'active');
if ( self.dropdown ) {
if ( !(isDropDown.test(self.tab.parentNode.parentNode.className)) ) {
if (/active/.test(self.dropdown.className)) self.removeClass(self.dropdown,'active');
} else {
if (!/active/.test(self.dropdown.className)) self.addClass(self.dropdown,'active');
}
}

//1. hide current active content first
Expand Down

0 comments on commit 35622a0

Please sign in to comment.