diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2014-09-13 06:20:45 +0400 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2014-09-13 06:20:45 +0400 |
commit | d527f208576e5f513eaac86d78a65fa890974572 (patch) | |
tree | 38ec5a369e949bf3978fcec5d9716585504a6f3e /assets/javascripts/bootstrap/tooltip.js | |
parent | 6e7f0f943bed639bc315ba26bc277a6af187fe1a (diff) |
rake convert
Diffstat (limited to 'assets/javascripts/bootstrap/tooltip.js')
-rw-r--r-- | assets/javascripts/bootstrap/tooltip.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/assets/javascripts/bootstrap/tooltip.js b/assets/javascripts/bootstrap/tooltip.js index aa6202f..1e10af2 100644 --- a/assets/javascripts/bootstrap/tooltip.js +++ b/assets/javascripts/bootstrap/tooltip.js @@ -281,7 +281,7 @@ $tip.removeClass('fade in top bottom left right') } - Tooltip.prototype.hide = function () { + Tooltip.prototype.hide = function (callback) { var that = this var $tip = this.tip() var e = $.Event('hide.bs.' + this.type) @@ -291,6 +291,7 @@ that.$element .removeAttr('aria-describedby') .trigger('hidden.bs.' + that.type) + callback && callback() } this.$element.trigger(e) @@ -329,6 +330,10 @@ var isSvg = window.SVGElement && el instanceof window.SVGElement var elRect = el.getBoundingClientRect() + if (elRect.width == null) { + // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 + elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) + } var elOffset = isBody ? { top: 0, left: 0 } : $element.offset() var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } var outerDims = isSvg ? {} : { @@ -434,8 +439,11 @@ } Tooltip.prototype.destroy = function () { + var that = this clearTimeout(this.timeout) - this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) + this.hide(function () { + that.$element.off('.' + that.type).removeData('bs.' + that.type) + }) } |