aboutsummaryrefslogtreecommitdiff
path: root/js/src/carousel
diff options
context:
space:
mode:
authorMarkus Hatvan <[email protected]>2019-08-22 21:17:34 +0200
committerXhmikosR <[email protected]>2019-08-22 22:17:34 +0300
commit4d101491da094418a768ff2f44be1ca85fd85922 (patch)
treedd6e4fe48b96df3cf4fe4f01839d1dd1aec8e0b2 /js/src/carousel
parent6885d65578b4938f3a8fdf1de65946c79415b94d (diff)
downloadbootstrap-4d101491da094418a768ff2f44be1ca85fd85922.tar.xz
bootstrap-4d101491da094418a768ff2f44be1ca85fd85922.zip
Remaining JS linting TODO (#29289)
* Enable and fix all occurrences with no-mixed-operators rule * Take care of the max-depth warning in button.js Signed-off-by: mhatvan <[email protected]>
Diffstat (limited to 'js/src/carousel')
-rw-r--r--js/src/carousel/carousel.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/src/carousel/carousel.js b/js/src/carousel/carousel.js
index 40984fe80..723bf57c6 100644
--- a/js/src/carousel/carousel.js
+++ b/js/src/carousel/carousel.js
@@ -377,8 +377,8 @@ class Carousel {
const isPrevDirection = direction === Direction.PREV
const activeIndex = this._getItemIndex(activeElement)
const lastItemIndex = this._items.length - 1
- const isGoingToWrap = isPrevDirection && activeIndex === 0 ||
- isNextDirection && activeIndex === lastItemIndex
+ const isGoingToWrap = (isPrevDirection && activeIndex === 0) ||
+ (isNextDirection && activeIndex === lastItemIndex)
if (isGoingToWrap && !this._config.wrap) {
return activeElement
@@ -424,8 +424,8 @@ class Carousel {
_slide(direction, element) {
const activeElement = SelectorEngine.findOne(Selector.ACTIVE_ITEM, this._element)
const activeElementIndex = this._getItemIndex(activeElement)
- const nextElement = element || activeElement &&
- this._getItemByDirection(direction, activeElement)
+ const nextElement = element || (activeElement &&
+ this._getItemByDirection(direction, activeElement))
const nextElementIndex = this._getItemIndex(nextElement)
const isCycling = Boolean(this._interval)