Skip to content

Commit 370ccdf

Browse files
committed
add updateParent config option in tabs
1 parent d65b237 commit 370ccdf

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/tabs/tabs.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
rotate: false,
2828

2929
// 1.2
30-
history: false
30+
history: false,
31+
updateParent: false
3132
},
3233

3334
addEffect: function(name, fn) {
@@ -159,9 +160,15 @@
159160

160161
// default behaviour
161162
current = i;
162-
tabs.removeClass(conf.current);
163-
tab.addClass(conf.current);
163+
tabs.removeClass(conf.current);
164+
tab.addClass(conf.current);
164165

166+
// update parent class as well
167+
if (conf.updateParent) {
168+
tabs.parent().removeClass(conf.current);
169+
tab.parent().addClass(conf.current);
170+
}
171+
165172
return self;
166173
},
167174

0 commit comments

Comments
 (0)