mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-28 20:52:21 +01:00
fix carousel event
This commit is contained in:
parent
8e6697f2b2
commit
edc3eee5ea
10
docs/assets/js/bootstrap-carousel.js
vendored
10
docs/assets/js/bootstrap-carousel.js
vendored
@ -94,9 +94,7 @@
|
||||
, direction = type == 'next' ? 'left' : 'right'
|
||||
, fallback = type == 'next' ? 'first' : 'last'
|
||||
, that = this
|
||||
, e = $.Event('slide', {
|
||||
relatedTarget: $next[0]
|
||||
})
|
||||
, e
|
||||
|
||||
this.sliding = true
|
||||
|
||||
@ -104,6 +102,10 @@
|
||||
|
||||
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
||||
|
||||
e = $.Event('slide', {
|
||||
relatedTarget: $next[0]
|
||||
})
|
||||
|
||||
if ($next.hasClass('active')) return
|
||||
|
||||
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||
@ -167,7 +169,7 @@
|
||||
$('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
|
||||
var $this = $(this), href
|
||||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
, options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
|
||||
, options = !$target.data('carousel') && $.extend({}, $target.data(), $this.data())
|
||||
$target.carousel(options)
|
||||
e.preventDefault()
|
||||
})
|
||||
|
5
docs/assets/js/bootstrap-tooltip.js
vendored
5
docs/assets/js/bootstrap-tooltip.js
vendored
@ -235,8 +235,9 @@
|
||||
this.enabled = !this.enabled
|
||||
}
|
||||
|
||||
, toggle: function () {
|
||||
this[this.tip().hasClass('in') ? 'hide' : 'show']()
|
||||
, toggle: function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||
self[self.tip().hasClass('in') ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
, destroy: function () {
|
||||
|
15
docs/assets/js/bootstrap.js
vendored
15
docs/assets/js/bootstrap.js
vendored
@ -337,9 +337,7 @@
|
||||
, direction = type == 'next' ? 'left' : 'right'
|
||||
, fallback = type == 'next' ? 'first' : 'last'
|
||||
, that = this
|
||||
, e = $.Event('slide', {
|
||||
relatedTarget: $next[0]
|
||||
})
|
||||
, e
|
||||
|
||||
this.sliding = true
|
||||
|
||||
@ -347,6 +345,10 @@
|
||||
|
||||
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
||||
|
||||
e = $.Event('slide', {
|
||||
relatedTarget: $next[0]
|
||||
})
|
||||
|
||||
if ($next.hasClass('active')) return
|
||||
|
||||
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||
@ -410,7 +412,7 @@
|
||||
$('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
|
||||
var $this = $(this), href
|
||||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
, options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
|
||||
, options = !$target.data('carousel') && $.extend({}, $target.data(), $this.data())
|
||||
$target.carousel(options)
|
||||
e.preventDefault()
|
||||
})
|
||||
@ -1193,8 +1195,9 @@
|
||||
this.enabled = !this.enabled
|
||||
}
|
||||
|
||||
, toggle: function () {
|
||||
this[this.tip().hasClass('in') ? 'hide' : 'show']()
|
||||
, toggle: function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||
self[self.tip().hasClass('in') ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
, destroy: function () {
|
||||
|
8
docs/assets/js/bootstrap.min.js
vendored
8
docs/assets/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
8
js/bootstrap-carousel.js
vendored
8
js/bootstrap-carousel.js
vendored
@ -94,9 +94,7 @@
|
||||
, direction = type == 'next' ? 'left' : 'right'
|
||||
, fallback = type == 'next' ? 'first' : 'last'
|
||||
, that = this
|
||||
, e = $.Event('slide', {
|
||||
relatedTarget: $next[0]
|
||||
})
|
||||
, e
|
||||
|
||||
this.sliding = true
|
||||
|
||||
@ -104,6 +102,10 @@
|
||||
|
||||
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
||||
|
||||
e = $.Event('slide', {
|
||||
relatedTarget: $next[0]
|
||||
})
|
||||
|
||||
if ($next.hasClass('active')) return
|
||||
|
||||
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user