Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJacob Thornton <jacobthornton@gmail.com>2013-08-11 01:09:05 +0400
committerJacob Thornton <jacobthornton@gmail.com>2013-08-11 01:09:05 +0400
commit1abb7947c2b24041efe02ae8e243e62e6afeb2c8 (patch)
tree0e510e729a2966f36c66ad12dfedf745e68c1f4b /js
parent7998c45570dba841d92ab2071562221fa733fc6b (diff)
fixes #9222
Diffstat (limited to 'js')
-rw-r--r--js/popover.js6
-rw-r--r--js/tooltip.js16
2 files changed, 11 insertions, 11 deletions
diff --git a/js/popover.js b/js/popover.js
index 24b85715fe..ecd37ac233 100644
--- a/js/popover.js
+++ b/js/popover.js
@@ -58,13 +58,9 @@
$tip.removeClass('fade top bottom left right in')
- // Hide empty titles
- //
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
// this manually by checking the contents.
- if ($tip.find('.popover-title').html() === '') {
- $tip.find('.popover-title').hide();
- }
+ if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
}
Popover.prototype.hasContent = function () {
diff --git a/js/tooltip.js b/js/tooltip.js
index cd4ee50ede..eedadcbe9a 100644
--- a/js/tooltip.js
+++ b/js/tooltip.js
@@ -64,7 +64,7 @@
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
- this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
}
@@ -91,16 +91,20 @@
return options
}
- Tooltip.prototype.enter = function (obj) {
- var defaults = this.getDefaults()
+ Tooltip.prototype.getDelegateOptions = function () {
var options = {}
+ var defaults = this.getDefaults()
this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
})
+ return options
+ }
+
+ Tooltip.prototype.enter = function (obj) {
var self = obj instanceof this.constructor ?
- obj : $(obj.currentTarget)[this.type](options).data('bs.' + this.type)
+ obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
@@ -114,7 +118,7 @@
Tooltip.prototype.leave = function (obj) {
var self = obj instanceof this.constructor ?
- obj : $(obj.currentTarget)[this.type](this._options).data('bs.' + this.type)
+ obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
@@ -339,7 +343,7 @@
}
Tooltip.prototype.toggle = function (e) {
- var self = e ? $(e.currentTarget)[this.type](this._options).data('bs.' + this.type) : this
+ var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
}