1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-13 09:04:14 +02:00
This commit is contained in:
Mark Otto
2017-01-21 17:50:45 -08:00
parent 4fa7749442
commit deb1c59c53
24 changed files with 583 additions and 1059 deletions

8
js/dist/carousel.js vendored
View File

@@ -129,7 +129,7 @@ var Carousel = function ($) {
if (this._isSliding) {
throw new Error('Carousel is sliding');
}
this._slide(Direction.PREVIOUS);
this._slide(Direction.PREV);
};
Carousel.prototype.pause = function pause(event) {
@@ -185,7 +185,7 @@ var Carousel = function ($) {
return;
}
var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS;
var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
this._slide(direction, this._items[index]);
};
@@ -256,7 +256,7 @@ var Carousel = function ($) {
Carousel.prototype._getItemByDirection = function _getItemByDirection(direction, activeElement) {
var isNextDirection = direction === Direction.NEXT;
var isPrevDirection = direction === Direction.PREVIOUS;
var isPrevDirection = direction === Direction.PREV;
var activeIndex = this._getItemIndex(activeElement);
var lastItemIndex = this._items.length - 1;
var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
@@ -265,7 +265,7 @@ var Carousel = function ($) {
return activeElement;
}
var delta = direction === Direction.PREVIOUS ? -1 : 1;
var delta = direction === Direction.PREV ? -1 : 1;
var itemIndex = (activeIndex + delta) % this._items.length;
return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];