mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-06 21:56:42 +02:00
fixes #11477 and updates slid event in carousel with namespace
This commit is contained in:
10
dist/js/bootstrap.js
vendored
10
dist/js/bootstrap.js
vendored
@@ -351,7 +351,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
|
|||||||
|
|
||||||
if (pos > (this.$items.length - 1) || pos < 0) return
|
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||||
|
|
||||||
if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
|
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
|
||||||
if (activeIndex == pos) return this.pause().cycle()
|
if (activeIndex == pos) return this.pause().cycle()
|
||||||
|
|
||||||
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||||
@@ -403,7 +403,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
|
|||||||
|
|
||||||
if (this.$indicators.length) {
|
if (this.$indicators.length) {
|
||||||
this.$indicators.find('.active').removeClass('active')
|
this.$indicators.find('.active').removeClass('active')
|
||||||
this.$element.one('slid', function () {
|
this.$element.one('slid.bs.carousel', function () {
|
||||||
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
||||||
$nextIndicator && $nextIndicator.addClass('active')
|
$nextIndicator && $nextIndicator.addClass('active')
|
||||||
})
|
})
|
||||||
@@ -421,7 +421,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
|
|||||||
$next.removeClass([type, direction].join(' ')).addClass('active')
|
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||||
$active.removeClass(['active', direction].join(' '))
|
$active.removeClass(['active', direction].join(' '))
|
||||||
that.sliding = false
|
that.sliding = false
|
||||||
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
|
||||||
})
|
})
|
||||||
.emulateTransitionEnd(600)
|
.emulateTransitionEnd(600)
|
||||||
} else {
|
} else {
|
||||||
@@ -430,7 +430,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
|
|||||||
$active.removeClass('active')
|
$active.removeClass('active')
|
||||||
$next.addClass('active')
|
$next.addClass('active')
|
||||||
this.sliding = false
|
this.sliding = false
|
||||||
this.$element.trigger('slid')
|
this.$element.trigger('slid.bs.carousel')
|
||||||
}
|
}
|
||||||
|
|
||||||
isCycling && this.cycle()
|
isCycling && this.cycle()
|
||||||
@@ -1700,7 +1700,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
|
|||||||
.addClass('active')
|
.addClass('active')
|
||||||
}
|
}
|
||||||
|
|
||||||
active.trigger('activate')
|
active.trigger('activate.bs.scrollspy')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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
File diff suppressed because one or more lines are too long
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
if (pos > (this.$items.length - 1) || pos < 0) return
|
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||||
|
|
||||||
if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
|
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
|
||||||
if (activeIndex == pos) return this.pause().cycle()
|
if (activeIndex == pos) return this.pause().cycle()
|
||||||
|
|
||||||
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
|
|
||||||
if (this.$indicators.length) {
|
if (this.$indicators.length) {
|
||||||
this.$indicators.find('.active').removeClass('active')
|
this.$indicators.find('.active').removeClass('active')
|
||||||
this.$element.one('slid', function () {
|
this.$element.one('slid.bs.carousel', function () {
|
||||||
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
||||||
$nextIndicator && $nextIndicator.addClass('active')
|
$nextIndicator && $nextIndicator.addClass('active')
|
||||||
})
|
})
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
$next.removeClass([type, direction].join(' ')).addClass('active')
|
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||||
$active.removeClass(['active', direction].join(' '))
|
$active.removeClass(['active', direction].join(' '))
|
||||||
that.sliding = false
|
that.sliding = false
|
||||||
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
|
||||||
})
|
})
|
||||||
.emulateTransitionEnd(600)
|
.emulateTransitionEnd(600)
|
||||||
} else {
|
} else {
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
$active.removeClass('active')
|
$active.removeClass('active')
|
||||||
$next.addClass('active')
|
$next.addClass('active')
|
||||||
this.sliding = false
|
this.sliding = false
|
||||||
this.$element.trigger('slid')
|
this.$element.trigger('slid.bs.carousel')
|
||||||
}
|
}
|
||||||
|
|
||||||
isCycling && this.cycle()
|
isCycling && this.cycle()
|
||||||
|
@@ -113,7 +113,7 @@
|
|||||||
.addClass('active')
|
.addClass('active')
|
||||||
}
|
}
|
||||||
|
|
||||||
active.trigger('activate')
|
active.trigger('activate.bs.scrollspy')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user