diff options
| author | Mark Otto <[email protected]> | 2013-08-17 17:31:58 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2013-08-17 17:31:58 -0700 |
| commit | ba20e512ce53e7cc771ba06d492a01d48db6cc97 (patch) | |
| tree | 30cebcbb796725c7dc06c9125714d83adbf585c3 /js/carousel.js | |
| parent | 2af9cf10ce2e93fe0ac07651d405abc484e4c608 (diff) | |
| parent | e29c23afab2577e05cfaa41f64a20f1ca87222fc (diff) | |
| download | bootstrap-ba20e512ce53e7cc771ba06d492a01d48db6cc97.tar.xz bootstrap-ba20e512ce53e7cc771ba06d492a01d48db6cc97.zip | |
Merge branch '3.0.0-wip' into bs3_theme
Conflicts:
dist/css/bootstrap.min.css
Diffstat (limited to 'js/carousel.js')
| -rw-r--r-- | js/carousel.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/js/carousel.js b/js/carousel.js index d4bcb88b7..d8c4c243c 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -41,6 +41,7 @@ Carousel.DEFAULTS = { interval: 5000 , pause: 'hover' + , wrap: true } Carousel.prototype.cycle = function (e) { @@ -105,12 +106,15 @@ var fallback = type == 'next' ? 'first' : 'last' var that = this + if (!$next.length) { + if (!this.options.wrap) return + $next = this.$element.find('.item')[fallback]() + } + this.sliding = true isCycling && this.pause() - $next = $next.length ? $next : this.$element.find('.item')[fallback]() - var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) if ($next.hasClass('active')) return |
