Skip to content

Commit

Permalink
fixes twbs#9222
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Aug 10, 2013
1 parent 7998c45 commit 1abb794
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
22 changes: 11 additions & 11 deletions dist/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
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))
}
}
Expand All @@ -1160,16 +1160,20 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
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)

Expand All @@ -1183,7 +1187,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }

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)

Expand Down Expand Up @@ -1408,7 +1412,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
}

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)
}

Expand Down Expand Up @@ -1506,13 +1510,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }

$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 () {
Expand Down
Loading

0 comments on commit 1abb794

Please sign in to comment.