Skip to content

Commit ad7182f

Browse files
committed
Implements twbs#13622.
options.animation can now accept a class name and toggle it on show and hide events.
1 parent 3dd1531 commit ad7182f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

js/tooltip.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@
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+
}
8792

8893
return options
8994
}
@@ -196,6 +201,7 @@
196201

197202
var complete = function() {
198203
that.$element.trigger('shown.bs.' + that.type)
204+
if (that.options._animation) that.$tip.addClass(that.options._animation)
199205
}
200206

201207
$.support.transition && this.$tip.hasClass('fade') ?
@@ -276,6 +282,7 @@
276282
function complete() {
277283
if (that.hoverState != 'in') $tip.detach()
278284
that.$element.trigger('hidden.bs.' + that.type)
285+
if (that.options._animation) that.$tip.removeClass(that.options._animation)
279286
}
280287

281288
this.$element.trigger(e)

0 commit comments

Comments
 (0)