Skip to content

Commit f329f62

Browse files
committed
Updated twbs#13622. Working css animations in tooltips.
The options.animation default key has been updated to 'fade'. Animation class modifications are done after everything is ready.
1 parent ad7182f commit f329f62

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

js/tooltip.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
Tooltip.VERSION = '3.1.1'
2929

3030
Tooltip.DEFAULTS = {
31-
animation: true,
31+
animation: 'fade',
3232
placement: 'top',
3333
selector: false,
3434
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
@@ -84,11 +84,6 @@
8484
hide: options.delay
8585
}
8686
}
87-
88-
if (options.animation && typeof options.animation == 'string') {
89-
options._animation = options.animation
90-
options.animation = false
91-
}
9287

9388
return options
9489
}
@@ -157,8 +152,6 @@
157152

158153
this.setContent()
159154

160-
if (this.options.animation) $tip.addClass('fade')
161-
162155
var placement = typeof this.options.placement == 'function' ?
163156
this.options.placement.call(this, $tip[0], this.$element[0]) :
164157
this.options.placement
@@ -201,7 +194,7 @@
201194

202195
var complete = function() {
203196
that.$element.trigger('shown.bs.' + that.type)
204-
if (that.options._animation) that.$tip.addClass(that.options._animation)
197+
if (that.options.animation) $tip.addClass(that.options.animation)
205198
}
206199

207200
$.support.transition && this.$tip.hasClass('fade') ?
@@ -282,7 +275,7 @@
282275
function complete() {
283276
if (that.hoverState != 'in') $tip.detach()
284277
that.$element.trigger('hidden.bs.' + that.type)
285-
if (that.options._animation) that.$tip.removeClass(that.options._animation)
278+
if (that.options.animation) $tip.removeClass(that.options.animation)
286279
}
287280

288281
this.$element.trigger(e)

0 commit comments

Comments
 (0)