aboutsummaryrefslogtreecommitdiff
path: root/js/carousel.js
diff options
context:
space:
mode:
authorfat <[email protected]>2013-12-24 12:50:55 -0800
committerfat <[email protected]>2013-12-24 12:50:55 -0800
commitfe7fffe034f8a97aae004351ee46fe9a704a971e (patch)
tree057217fcc2a4dd86ad02f26234d9e5a6784c739f /js/carousel.js
parent0a75e4c09b77035e9492006647da8d1900d24f75 (diff)
parented1bd2b150dd645c11f92126a12183985ddbbc15 (diff)
downloadbootstrap-fe7fffe034f8a97aae004351ee46fe9a704a971e.tar.xz
bootstrap-fe7fffe034f8a97aae004351ee46fe9a704a971e.zip
Merge branch 'slide-event-reset' of git://github.com/Rowno/bootstrap into Rowno-slide-event-reset
Conflicts: js/tests/unit/carousel.js
Diffstat (limited to 'js/carousel.js')
-rw-r--r--js/carousel.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/js/carousel.js b/js/carousel.js
index be3ecf3de..fbd055116 100644
--- a/js/carousel.js
+++ b/js/carousel.js
@@ -100,13 +100,15 @@
$next = this.$element.find('.item')[fallback]()
}
- this.sliding = true
-
- isCycling && this.pause()
+ if ($next.hasClass('active')) return
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
+ this.$element.trigger(e)
+ if (e.isDefaultPrevented()) return
- if ($next.hasClass('active')) return
+ this.sliding = true
+
+ isCycling && this.pause()
if (this.$indicators.length) {
this.$indicators.find('.active').removeClass('active')
@@ -117,8 +119,6 @@
}
if ($.support.transition && this.$element.hasClass('slide')) {
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
@@ -132,8 +132,6 @@
})
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
} else {
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
$active.removeClass('active')
$next.addClass('active')
this.sliding = false