diff options
| author | Jacob Thornton <[email protected]> | 2011-12-24 23:06:16 -0800 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2011-12-24 23:06:16 -0800 |
| commit | 12868933b9141ff9c63277efe36665cc7a8815df (patch) | |
| tree | fc0ec881fede7ab982b3c1c5039de6be711b0ba6 | |
| parent | 4ef5a90445f3adf86dd7cf96e588be1250403e84 (diff) | |
| download | bootstrap-12868933b9141ff9c63277efe36665cc7a8815df.tar.xz bootstrap-12868933b9141ff9c63277efe36665cc7a8815df.zip | |
clean up dead elements in firefox (which is droping transitionEnd events :(
| -rw-r--r-- | js/bootstrap-twipsy.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/js/bootstrap-twipsy.js b/js/bootstrap-twipsy.js index 2651e3822..a176f0908 100644 --- a/js/bootstrap-twipsy.js +++ b/js/bootstrap-twipsy.js @@ -164,13 +164,20 @@ $tip.removeClass('in') - function removeElement () { - $tip.remove() + function removeWithAnimation() { + var timeout = setTimeout(function () { + $tip.off($.support.transition.end).remove() + }, 500) + + $tip.one($.support.transition.end, function () { + clearTimeout(timeout) + $tip.remove() + }) } $.support.transition && this.$tip.hasClass('fade') ? - $tip.on($.support.transition.end, removeElement) : - removeElement() + removeWithAnimation() : + $tip.remove() } , fixTitle: function () { |
