summaryrefslogtreecommitdiff
path: root/bower_components/bootstrap/js/carousel.js
diff options
context:
space:
mode:
Diffstat (limited to 'bower_components/bootstrap/js/carousel.js')
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/carousel.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/bower_components/bootstrap/js/carousel.js b/bower_components/bootstrap/js/carousel.js
index d4bcb88b..d8c4c243 100644..100755
--- a/bower_components/bootstrap/js/carousel.js
+++ b/bower_components/bootstrap/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