Skip to content

Commit

Permalink
Properly hide tooltip when it is destroyed
Browse files Browse the repository at this point in the history
Fixes #13031
  • Loading branch information
hnrch02 committed Sep 8, 2014
1 parent 9702579 commit 122c5f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -291,6 +291,7 @@
that.$element
.removeAttr('aria-describedby')
.trigger('hidden.bs.' + that.type)
callback && callback()
}

this.$element.trigger(e)
Expand Down Expand Up @@ -434,8 +435,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)
})
}


Expand Down

0 comments on commit 122c5f2

Please sign in to comment.