1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-27 05:49:07 +02:00

refactor(plugins): query elements without jquery

This commit is contained in:
Johann-S
2018-06-01 14:44:21 +02:00
parent ffd31f9b8c
commit a79b8aa16a
9 changed files with 67 additions and 47 deletions

View File

@@ -418,9 +418,9 @@ const Tooltip = (($) => {
}
setContent() {
const $tip = $(this.getTipElement())
this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle())
$tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
const tip = this.getTipElement()
this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle())
$(tip).removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
}
setElementContent($element, content) {
@@ -655,7 +655,7 @@ const Tooltip = (($) => {
_cleanTipClass() {
const $tip = $(this.getTipElement())
const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)
if (tabClass !== null && tabClass.length > 0) {
if (tabClass !== null && tabClass.length) {
$tip.removeClass(tabClass.join(''))
}
}