mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
Fix bad position for Tooltips with animation at true
This commit is contained in:
parent
0cdf176f7a
commit
cc455c16c3
@ -306,8 +306,6 @@ const Tooltip = (($) => {
|
||||
}
|
||||
})
|
||||
|
||||
Util.reflow(tip)
|
||||
|
||||
$(tip).addClass(ClassName.SHOW)
|
||||
|
||||
// if this is a touch-enabled device we add extra
|
||||
@ -319,6 +317,9 @@ const Tooltip = (($) => {
|
||||
}
|
||||
|
||||
const complete = () => {
|
||||
if (this.config.animation) {
|
||||
this._fixTransition()
|
||||
}
|
||||
const prevHoverState = this._hoverState
|
||||
this._hoverState = null
|
||||
|
||||
@ -333,10 +334,10 @@ const Tooltip = (($) => {
|
||||
$(this.tip)
|
||||
.one(Util.TRANSITION_END, complete)
|
||||
.emulateTransitionEnd(Tooltip._TRANSITION_DURATION)
|
||||
return
|
||||
}
|
||||
|
||||
complete()
|
||||
else {
|
||||
complete()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -663,6 +664,19 @@ const Tooltip = (($) => {
|
||||
this.addAttachmentClass(this._getAttachment(data.placement))
|
||||
}
|
||||
|
||||
_fixTransition() {
|
||||
const tip = this.getTipElement()
|
||||
const initConfigAnimation = this.config.animation
|
||||
if (tip.getAttribute('x-placement') !== null) {
|
||||
return;
|
||||
}
|
||||
$(tip).removeClass(ClassName.FADE)
|
||||
this.config.animation = false
|
||||
this.hide()
|
||||
this.show()
|
||||
this.config.animation = initConfigAnimation
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
static _jQueryInterface(config) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user