1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-23 09:41:11 +00:00

Fix bad position for Tooltips with animation at true

This commit is contained in:
Johann-S 2017-05-12 09:39:27 +02:00
parent 0cdf176f7a
commit cc455c16c3

View File

@ -306,8 +306,6 @@ const Tooltip = (($) => {
} }
}) })
Util.reflow(tip)
$(tip).addClass(ClassName.SHOW) $(tip).addClass(ClassName.SHOW)
// if this is a touch-enabled device we add extra // if this is a touch-enabled device we add extra
@ -319,6 +317,9 @@ const Tooltip = (($) => {
} }
const complete = () => { const complete = () => {
if (this.config.animation) {
this._fixTransition()
}
const prevHoverState = this._hoverState const prevHoverState = this._hoverState
this._hoverState = null this._hoverState = null
@ -333,10 +334,10 @@ const Tooltip = (($) => {
$(this.tip) $(this.tip)
.one(Util.TRANSITION_END, complete) .one(Util.TRANSITION_END, complete)
.emulateTransitionEnd(Tooltip._TRANSITION_DURATION) .emulateTransitionEnd(Tooltip._TRANSITION_DURATION)
return
} }
else {
complete() complete()
}
} }
} }
@ -663,6 +664,19 @@ const Tooltip = (($) => {
this.addAttachmentClass(this._getAttachment(data.placement)) 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
static _jQueryInterface(config) { static _jQueryInterface(config) {