mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-13 09:04:14 +02:00
grunt
This commit is contained in:
8
js/dist/carousel.js
vendored
8
js/dist/carousel.js
vendored
@@ -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];
|
||||
|
Reference in New Issue
Block a user