Skip to content

Commit

Permalink
fixes #11477 and updates slid event in carousel with namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Nov 15, 2013
1 parent 57b59fc commit 7545da2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions dist/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"

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()

return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
Expand Down Expand Up @@ -403,7 +403,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"

if (this.$indicators.length) {
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()])
$nextIndicator && $nextIndicator.addClass('active')
})
Expand All @@ -421,7 +421,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () { that.$element.trigger('slid') }, 0)
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
})
.emulateTransitionEnd(600)
} else {
Expand All @@ -430,7 +430,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger('slid')
this.$element.trigger('slid.bs.carousel')
}

isCycling && this.cycle()
Expand Down Expand Up @@ -1700,7 +1700,7 @@ if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery"
.addClass('active')
}

active.trigger('activate')
active.trigger('activate.bs.scrollspy')
}


Expand Down
2 changes: 1 addition & 1 deletion dist/js/bootstrap.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs-assets/js/raw-files.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions js/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

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()

return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
Expand Down Expand Up @@ -121,7 +121,7 @@

if (this.$indicators.length) {
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()])
$nextIndicator && $nextIndicator.addClass('active')
})
Expand All @@ -139,7 +139,7 @@
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () { that.$element.trigger('slid') }, 0)
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
})
.emulateTransitionEnd(600)
} else {
Expand All @@ -148,7 +148,7 @@
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger('slid')
this.$element.trigger('slid.bs.carousel')
}

isCycling && this.cycle()
Expand Down
2 changes: 1 addition & 1 deletion js/scrollspy.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
.addClass('active')
}

active.trigger('activate')
active.trigger('activate.bs.scrollspy')
}


Expand Down

0 comments on commit 7545da2

Please sign in to comment.