diff options
| author | KAWACHI Takashi <[email protected]> | 2012-12-14 16:35:11 +0900 |
|---|---|---|
| committer | KAWACHI Takashi <[email protected]> | 2012-12-23 14:42:13 +0900 |
| commit | 7a3a88acc60f7055720b919e281d3c881d05916f (patch) | |
| tree | ca10fd459d0cd40cb188bcb1d3e5b587377e448f /js/bootstrap-tooltip.js | |
| parent | 48211ad9f572504cdfa00273a66d701e62ec291d (diff) | |
| download | bootstrap-7a3a88acc60f7055720b919e281d3c881d05916f.tar.xz bootstrap-7a3a88acc60f7055720b919e281d3c881d05916f.zip | |
Tooltips fires show, shown, hide, hidden events
It is re-worked from #3691.
Diffstat (limited to 'js/bootstrap-tooltip.js')
| -rw-r--r-- | js/bootstrap-tooltip.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index d908b0cf8..2a79490b1 100644 --- a/js/bootstrap-tooltip.js +++ b/js/bootstrap-tooltip.js @@ -110,8 +110,11 @@ , actualHeight , placement , tp + , e if (this.hasContent() && this.enabled) { + this.$element.trigger(e = $.Event('show')) + if (e.isDefaultPrevented()) return $tip = this.tip() this.setContent() @@ -152,6 +155,8 @@ .offset(tp) .addClass(placement) .addClass('in') + + this.$element.trigger('shown') } } @@ -166,6 +171,10 @@ , hide: function () { var that = this , $tip = this.tip() + , e + + this.$element.trigger(e = $.Event('hide')) + if (e.isDefaultPrevented()) return $tip.removeClass('in') @@ -184,6 +193,8 @@ removeWithAnimation() : $tip.detach() + this.$element.trigger('hidden') + return this } |
