aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-08-17 21:00:20 -0700
committerMark Otto <[email protected]>2013-08-17 21:00:20 -0700
commit9533a1339f4d841d26da43bc833ed997b56140c9 (patch)
treecfe9eb960981189b447b849229a686aa5859feae /js
parent5539db523743c177a2ebb7d878343776abf6b7b4 (diff)
parent47fcb322eb3e31a625eacf77650194ba87aa6b9a (diff)
downloadbootstrap-9533a1339f4d841d26da43bc833ed997b56140c9.tar.xz
bootstrap-9533a1339f4d841d26da43bc833ed997b56140c9.zip
Merge branch '3.0.0-wip' of github.com:twbs/bootstrap into 3.0.0-wip
Diffstat (limited to 'js')
-rw-r--r--js/tooltip.js14
-rw-r--r--js/transition.js2
2 files changed, 10 insertions, 6 deletions
diff --git a/js/tooltip.js b/js/tooltip.js
index e0732a5a9..89802287a 100644
--- a/js/tooltip.js
+++ b/js/tooltip.js
@@ -108,10 +108,11 @@
clearTimeout(self.timeout)
+ self.hoverState = 'in'
+
if (!self.options.delay || !self.options.delay.show) return self.show()
- self.hoverState = 'in'
- self.timeout = setTimeout(function () {
+ self.timeout = setTimeout(function () {
if (self.hoverState == 'in') self.show()
}, self.options.delay.show)
}
@@ -122,10 +123,11 @@
clearTimeout(self.timeout)
+ self.hoverState = 'out'
+
if (!self.options.delay || !self.options.delay.hide) return self.hide()
- self.hoverState = 'out'
- self.timeout = setTimeout(function () {
+ self.timeout = setTimeout(function () {
if (self.hoverState == 'out') self.hide()
}, self.options.delay.hide)
}
@@ -258,7 +260,9 @@
var $tip = this.tip()
var e = $.Event('hide.bs.' + this.type)
- function complete() { $tip.detach() }
+ function complete() {
+ if (that.hoverState != 'in') $tip.detach()
+ }
this.$element.trigger(e)
diff --git a/js/transition.js b/js/transition.js
index 0cdcf9ea3..e8f318beb 100644
--- a/js/transition.js
+++ b/js/transition.js
@@ -42,7 +42,7 @@
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
- var called = false, $el = this
+ var called = false, $el = this
$(this).one($.support.transition.end, function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)