mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 10:34:07 +02:00
fixes #9222
This commit is contained in:
22
dist/js/bootstrap.js
vendored
22
dist/js/bootstrap.js
vendored
@@ -1133,7 +1133,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
|
|||||||
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
|
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||||
var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
|
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))
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1160,16 +1160,20 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
|
|||||||
return options
|
return options
|
||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.prototype.enter = function (obj) {
|
Tooltip.prototype.getDelegateOptions = function () {
|
||||||
var defaults = this.getDefaults()
|
|
||||||
var options = {}
|
var options = {}
|
||||||
|
var defaults = this.getDefaults()
|
||||||
|
|
||||||
this._options && $.each(this._options, function (key, value) {
|
this._options && $.each(this._options, function (key, value) {
|
||||||
if (defaults[key] != value) options[key] = value
|
if (defaults[key] != value) options[key] = value
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.enter = function (obj) {
|
||||||
var self = obj instanceof this.constructor ?
|
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)
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
@@ -1183,7 +1187,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
|
|||||||
|
|
||||||
Tooltip.prototype.leave = function (obj) {
|
Tooltip.prototype.leave = function (obj) {
|
||||||
var self = obj instanceof this.constructor ?
|
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)
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
@@ -1408,7 +1412,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
|
|||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.prototype.toggle = function (e) {
|
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)
|
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1506,13 +1510,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
|
|||||||
|
|
||||||
$tip.removeClass('fade top bottom left right in')
|
$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
|
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
||||||
// this manually by checking the contents.
|
// this manually by checking the contents.
|
||||||
if ($tip.find('.popover-title').html() === '') {
|
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
||||||
$tip.find('.popover-title').hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Popover.prototype.hasContent = function () {
|
Popover.prototype.hasContent = function () {
|
||||||
|
2
dist/js/bootstrap.min.js
vendored
2
dist/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -58,13 +58,9 @@
|
|||||||
|
|
||||||
$tip.removeClass('fade top bottom left right in')
|
$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
|
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
||||||
// this manually by checking the contents.
|
// this manually by checking the contents.
|
||||||
if ($tip.find('.popover-title').html() === '') {
|
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
||||||
$tip.find('.popover-title').hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Popover.prototype.hasContent = function () {
|
Popover.prototype.hasContent = function () {
|
||||||
|
@@ -64,7 +64,7 @@
|
|||||||
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
|
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||||
var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
|
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))
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,16 +91,20 @@
|
|||||||
return options
|
return options
|
||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.prototype.enter = function (obj) {
|
Tooltip.prototype.getDelegateOptions = function () {
|
||||||
var defaults = this.getDefaults()
|
|
||||||
var options = {}
|
var options = {}
|
||||||
|
var defaults = this.getDefaults()
|
||||||
|
|
||||||
this._options && $.each(this._options, function (key, value) {
|
this._options && $.each(this._options, function (key, value) {
|
||||||
if (defaults[key] != value) options[key] = value
|
if (defaults[key] != value) options[key] = value
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.enter = function (obj) {
|
||||||
var self = obj instanceof this.constructor ?
|
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)
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
@@ -114,7 +118,7 @@
|
|||||||
|
|
||||||
Tooltip.prototype.leave = function (obj) {
|
Tooltip.prototype.leave = function (obj) {
|
||||||
var self = obj instanceof this.constructor ?
|
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)
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
@@ -339,7 +343,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.prototype.toggle = function (e) {
|
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)
|
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user