2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-30 15:24:08 +03:00

use get selector from element only when needed

This commit is contained in:
Johann-S
2019-07-23 21:15:00 +02:00
parent f4dbffe93a
commit fc02932946
8 changed files with 82 additions and 49 deletions
+2 -7
View File
@@ -9,7 +9,7 @@ import {
jQuery as $,
TRANSITION_END,
emulateTransitionEnd,
getSelectorFromElement,
getElementFromSelector,
getTransitionDurationFromElement,
makeArray,
reflow
@@ -85,10 +85,9 @@ class Tab {
return
}
let target
let previous
const target = getElementFromSelector(this._element)
const listElement = SelectorEngine.closest(this._element, Selector.NAV_LIST_GROUP)
const selector = getSelectorFromElement(this._element)
if (listElement) {
const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE
@@ -113,10 +112,6 @@ class Tab {
return
}
if (selector) {
target = SelectorEngine.findOne(selector)
}
this._activate(
this._element,
listElement