diff options
| author | Pierre Vanduynslager <[email protected]> | 2017-04-08 18:43:25 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-04-08 18:43:25 -0400 |
| commit | fe72daf2b34263d3cfc9bc77e9998cd22adfa34d (patch) | |
| tree | 15dc9fc6fcb513362ba112d52ab01b568b423709 /js/src/tab.js | |
| parent | f5cc59145642d78d7abbdf38fee1905786da5367 (diff) | |
| parent | feb35b94a61c4d6016be8d1773a79a6bbe57d856 (diff) | |
| download | bootstrap-fe72daf2b34263d3cfc9bc77e9998cd22adfa34d.tar.xz bootstrap-fe72daf2b34263d3cfc9bc77e9998cd22adfa34d.zip | |
Merge branch 'v4-dev' into dropdown-keyboard
Diffstat (limited to 'js/src/tab.js')
| -rw-r--r-- | js/src/tab.js | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/js/src/tab.js b/js/src/tab.js index c069b0a9a..6f8187d17 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -42,14 +42,10 @@ const Tab = (($) => { } const Selector = { - 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', + NAV_LIST_GROUP : '.nav, .list-group', ACTIVE : '.active', - ACTIVE_CHILD : '> .nav-item > .active, > .active', - DATA_TOGGLE : '[data-toggle="tab"], [data-toggle="pill"]', + DATA_TOGGLE : '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', DROPDOWN_TOGGLE : '.dropdown-toggle', DROPDOWN_ACTIVE_CHILD : '> .dropdown-menu .active' } @@ -87,7 +83,7 @@ const Tab = (($) => { let target let previous - const listElement = $(this._element).closest(Selector.LIST)[0] + const listElement = $(this._element).closest(Selector.NAV_LIST_GROUP)[0] const selector = Util.getSelectorFromElement(this._element) if (listElement) { @@ -152,11 +148,10 @@ const Tab = (($) => { // private _activate(element, container, callback) { - const active = $(container).find(Selector.ACTIVE_CHILD)[0] + const active = $(container).find(Selector.ACTIVE)[0] const isTransitioning = callback && Util.supportsTransitionEnd() - && (active && $(active).hasClass(ClassName.FADE) - || Boolean($(container).find(Selector.FADE_CHILD)[0])) + && (active && $(active).hasClass(ClassName.FADE)) const complete = () => this._transitionComplete( element, |
