]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Properly fire hidden event when tooltip is destroyed 14571/head
authorHeinrich Fenkart <hnrch02@gmail.com>
Mon, 8 Sep 2014 22:17:32 +0000 (00:17 +0200)
committerHeinrich Fenkart <hnrch02@gmail.com>
Sat, 13 Sep 2014 01:07:32 +0000 (03:07 +0200)
Fixes #13031.

js/tooltip.js

index 5192d38fcad244a8184828419c37d6c44924cfeb..1e10af27fee7bbd81621f37cbc22d111bb36a922 100644 (file)
     $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)
       that.$element
         .removeAttr('aria-describedby')
         .trigger('hidden.bs.' + that.type)
+      callback && callback()
     }
 
     this.$element.trigger(e)
   }
 
   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)
+    })
   }