mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 18:44:01 +02:00
Merge remote-tracking branch 'bootstrap/3.0.0-wip' into 3.0.0-wip
This commit is contained in:
@@ -194,7 +194,7 @@
|
||||
$target.carousel(options)
|
||||
|
||||
if (slideIndex = $this.attr('data-slide-to')) {
|
||||
$target.data('bs-carousel').pause().to(slideIndex).cycle()
|
||||
$target.data('bs.carousel').pause().to(slideIndex).cycle()
|
||||
}
|
||||
|
||||
e.preventDefault()
|
||||
|
14
js/modal.js
14
js/modal.js
@@ -106,18 +106,18 @@
|
||||
Modal.prototype.enforceFocus = function () {
|
||||
$(document)
|
||||
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||
.on('focusin.bs.modal', function (e) {
|
||||
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
||||
this.$element.focus()
|
||||
}
|
||||
}, this)
|
||||
.on('focusin.bs.modal', $.proxy(function (e) {
|
||||
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
||||
this.$element.focus()
|
||||
}
|
||||
}, this))
|
||||
}
|
||||
|
||||
Modal.prototype.escape = function () {
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
this.$element.on('keyup.dismiss.bs.modal', function ( e ) {
|
||||
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
||||
e.which == 27 && this.hide()
|
||||
}, this)
|
||||
}, this))
|
||||
} else if (!this.isShown) {
|
||||
this.$element.off('keyup.dismiss.bs.modal')
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@
|
||||
return options
|
||||
}
|
||||
|
||||
Tooltip.prototype.enter = function (e) {
|
||||
Tooltip.prototype.enter = function (obj) {
|
||||
var defaults = this.getDefaults()
|
||||
var options = {}
|
||||
|
||||
@@ -99,26 +99,29 @@
|
||||
if (defaults[key] != value) options[key] = value
|
||||
})
|
||||
|
||||
var self = $(e.currentTarget)[this.type](options).data('bs.' + this.type)
|
||||
var self = obj instanceof this.constructor ?
|
||||
obj : $(obj.currentTarget)[this.type](options).data('bs.' + this.type)
|
||||
|
||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||
|
||||
clearTimeout(this.timeout)
|
||||
|
||||
self.hoverState = 'in'
|
||||
this.timeout = setTimeout(function() {
|
||||
this.timeout = setTimeout(function () {
|
||||
if (self.hoverState == 'in') self.show()
|
||||
}, self.options.delay.show)
|
||||
}
|
||||
|
||||
Tooltip.prototype.leave = function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data('bs.' + this.type)
|
||||
Tooltip.prototype.leave = function (obj) {
|
||||
var self = obj instanceof this.constructor ?
|
||||
obj : $(obj.currentTarget)[this.type](this._options).data('bs.' + this.type)
|
||||
|
||||
clearTimeout(this.timeout)
|
||||
|
||||
if (this.timeout) clearTimeout(this.timeout)
|
||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||
|
||||
self.hoverState = 'out'
|
||||
this.timeout = setTimeout(function() {
|
||||
this.timeout = setTimeout(function () {
|
||||
if (self.hoverState == 'out') self.hide()
|
||||
}, self.options.delay.hide)
|
||||
}
|
||||
@@ -315,7 +318,7 @@
|
||||
|
||||
Tooltip.prototype.toggle = function (e) {
|
||||
var self = e ? $(e.currentTarget)[this.type](this._options).data('bs.' + this.type) : this
|
||||
self.tip().hasClass('in') ? self.hide() : self.show()
|
||||
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
||||
}
|
||||
|
||||
Tooltip.prototype.destroy = function () {
|
||||
|
Reference in New Issue
Block a user