diff options
| author | XhmikosR <[email protected]> | 2014-08-01 19:49:54 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2014-08-01 19:49:54 +0300 |
| commit | de1d8c36ada0a36691c1c9120755455f3bbcd2ea (patch) | |
| tree | 008a2e6cc4958faaea81f38d3633e4f88b523c05 /docs/dist/js/bootstrap.js | |
| parent | 1625102671e9b244efb57be1317fa7ce6ca7b5b9 (diff) | |
| download | bootstrap-de1d8c36ada0a36691c1c9120755455f3bbcd2ea.tar.xz bootstrap-de1d8c36ada0a36691c1c9120755455f3bbcd2ea.zip | |
Run `grunt`.
Diffstat (limited to 'docs/dist/js/bootstrap.js')
| -rw-r--r-- | docs/dist/js/bootstrap.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/dist/js/bootstrap.js b/docs/dist/js/bootstrap.js index 85db916ab..2e1de9dd0 100644 --- a/docs/dist/js/bootstrap.js +++ b/docs/dist/js/bootstrap.js @@ -339,6 +339,13 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re return this.$items.index(item || this.$active) } + Carousel.prototype.getItemForDirection = function (direction, active) { + var delta = direction == 'prev' ? -1 : 1 + var activeIndex = this.getItemIndex(active) + var itemIndex = (activeIndex + delta) % this.$items.length + return this.$items.eq(itemIndex) + } + Carousel.prototype.to = function (pos) { var that = this var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) @@ -348,7 +355,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" if (activeIndex == pos) return this.pause().cycle() - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) } Carousel.prototype.pause = function (e) { @@ -376,7 +383,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re Carousel.prototype.slide = function (type, next) { var $active = this.$element.find('.item.active') - var $next = next || $active[type]() + var $next = next || this.getItemForDirection(type, $active) var isCycling = this.interval var direction = type == 'next' ? 'left' : 'right' var fallback = type == 'next' ? 'first' : 'last' |
