From 045888fa3887f5e65658499da11c8ad737222759 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 6 Jan 2017 08:38:04 -0800 Subject: version bump --- js/src/tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/src/tab.js') diff --git a/js/src/tab.js b/js/src/tab.js index 745aa808b..c069b0a9a 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -3,7 +3,7 @@ import Util from './util' /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.5): tab.js + * Bootstrap (v4.0.0-alpha.6): tab.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -18,7 +18,7 @@ const Tab = (($) => { */ const NAME = 'tab' - const VERSION = '4.0.0-alpha.5' + const VERSION = '4.0.0-alpha.6' const DATA_KEY = 'bs.tab' const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' -- cgit v1.2.3 From 1a46d8c7309092566c2da8cbaa9999ae0a1bacc7 Mon Sep 17 00:00:00 2001 From: Johann Date: Sun, 19 Mar 2017 00:36:33 +0100 Subject: Allow to use Tab.js with list-group (#21756) * Allow to use Tab.js with list-group * Allow to use list-group with div parent instead of an ul parent --- js/src/tab.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'js/src/tab.js') diff --git a/js/src/tab.js b/js/src/tab.js index c069b0a9a..d5669b7ad 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -45,10 +45,10 @@ const Tab = (($) => { A : 'a', LI : 'li', DROPDOWN : '.dropdown', - LIST : 'ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)', - FADE_CHILD : '> .nav-item .fade, > .fade', + LIST : 'ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu), .list-group:not(.dropdown-menu)', + FADE_CHILD : '> .nav-item .fade, > .list-group-item .fade, > .fade', ACTIVE : '.active', - ACTIVE_CHILD : '> .nav-item > .active, > .active', + ACTIVE_CHILD : '> .nav-item > .active, > .list-group-item > .active, > .active', DATA_TOGGLE : '[data-toggle="tab"], [data-toggle="pill"]', DROPDOWN_TOGGLE : '.dropdown-toggle', DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active' @@ -182,6 +182,9 @@ const Tab = (($) => { _transitionComplete(element, active, isTransitioning, callback) { if (active) { $(active).removeClass(ClassName.ACTIVE) + if ($(active).hasClass('list-group-item')) { + $(active).find('a.nav-link').removeClass(ClassName.ACTIVE) + } const dropdownChild = $(active.parentNode).find( Selector.DROPDOWN_ACTIVE_CHILD @@ -195,6 +198,9 @@ const Tab = (($) => { } $(element).addClass(ClassName.ACTIVE) + if ($(element.parentNode).hasClass('list-group-item')) { + $(element.parentNode).addClass(ClassName.ACTIVE) + } element.setAttribute('aria-expanded', true) if (isTransitioning) { -- cgit v1.2.3 From 91b62941afb7115807fc2925398ebccfc68f5377 Mon Sep 17 00:00:00 2001 From: Pierre Vanduynslager Date: Sun, 2 Apr 2017 05:21:04 -0400 Subject: Tabs/Scrollspy/.nav/.list-group/.active independent of markup (