]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
When we show our tabs element use children to be more restrictive
authorJohann-S <johann.servoire@gmail.com>
Sun, 16 Jul 2017 14:04:37 +0000 (16:04 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Fri, 11 Aug 2017 12:04:07 +0000 (15:04 +0300)
js/src/tab.js

index 4fd69c50714d57f82b878f34505033934453e1aa..5e5a83118da248bfb7e77fc242bb799987b2f3c0 100644 (file)
@@ -44,7 +44,7 @@ const Tab = (($) => {
   const Selector = {
     DROPDOWN              : '.dropdown',
     NAV_LIST_GROUP        : '.nav, .list-group',
-    ACTIVE                : '> .nav-item > .active, > .active',
+    ACTIVE                : '.active',
     DATA_TOGGLE           : '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
     DROPDOWN_TOGGLE       : '.dropdown-toggle',
     DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active'
@@ -148,7 +148,8 @@ const Tab = (($) => {
     // private
 
     _activate(element, container, callback) {
-      const active          = $(container).find(Selector.ACTIVE)[0]
+      const activeElements  = callback ? $(container).children(Selector.ACTIVE) : $(container).find(Selector.ACTIVE)
+      const active          = activeElements[0]
       const isTransitioning = callback
         && Util.supportsTransitionEnd()
         && (active && $(active).hasClass(ClassName.FADE))