From 4d101491da094418a768ff2f44be1ca85fd85922 Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Thu, 22 Aug 2019 21:17:34 +0200 Subject: 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 --- js/src/carousel/carousel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'js/src/carousel') 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) -- cgit v1.2.3