aboutsummaryrefslogtreecommitdiff
path: root/docs/dist/js/bootstrap.js
diff options
context:
space:
mode:
authorHeinrich Fenkart <[email protected]>2014-11-17 18:57:02 +0100
committerHeinrich Fenkart <[email protected]>2014-11-17 18:57:02 +0100
commitc2abfc0a4427237e288eee06a364662345fbbf9d (patch)
tree1ef2d027697b1e2bccc6b3861b66d815ab076fd4 /docs/dist/js/bootstrap.js
parent6503cb08228450eb14bbf4402f5bf7022f90216e (diff)
downloadbootstrap-c2abfc0a4427237e288eee06a364662345fbbf9d.tar.xz
bootstrap-c2abfc0a4427237e288eee06a364662345fbbf9d.zip
grunt
Diffstat (limited to 'docs/dist/js/bootstrap.js')
-rw-r--r--docs/dist/js/bootstrap.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/docs/dist/js/bootstrap.js b/docs/dist/js/bootstrap.js
index b6ac8d990..50a4c3cc7 100644
--- a/docs/dist/js/bootstrap.js
+++ b/docs/dist/js/bootstrap.js
@@ -359,8 +359,11 @@ if (typeof jQuery === 'undefined') {
}
Carousel.prototype.getItemForDirection = function (direction, active) {
- var delta = direction == 'prev' ? -1 : 1
var activeIndex = this.getItemIndex(active)
+ var willWrap = (direction == 'prev' && activeIndex === 0)
+ || (direction == 'next' && activeIndex == (this.$items.length - 1))
+ if (willWrap && !this.options.wrap) return active
+ var delta = direction == 'prev' ? -1 : 1
var itemIndex = (activeIndex + delta) % this.$items.length
return this.$items.eq(itemIndex)
}
@@ -405,14 +408,8 @@ if (typeof jQuery === 'undefined') {
var $next = next || this.getItemForDirection(type, $active)
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
- var fallback = type == 'next' ? 'first' : 'last'
var that = this
- if (!$next.length) {
- if (!this.options.wrap) return
- $next = this.$element.find('.item')[fallback]()
- }
-
if ($next.hasClass('active')) return (this.sliding = false)
var relatedTarget = $next[0]
@@ -576,7 +573,7 @@ if (typeof jQuery === 'undefined') {
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
- var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing')
+ var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
if (actives && actives.length) {
activesData = actives.data('bs.collapse')