Skip to content

Commit 07460ed

Browse files
sandyaggarwalcjelger
authored andcommitted
CIF-959- Improvements for Product Carousel component
- Hide Navigation arrows when all the products are displayed in current viewport - Center component
1 parent a47c1de commit 07460ed

File tree

1 file changed

+2
-4
lines changed
  • ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcarousel/v1/productcarousel/clientlibs/js

1 file changed

+2
-4
lines changed

ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/productcarousel/v1/productcarousel/clientlibs/js/product-carousel.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
this._currentPos = 0;
3636

3737
this._minPos = this._product_carousel_parent.offsetWidth - this._cards.length * this._cards[0].offsetWidth;
38-
39-
this._cardsContainer.style.marginLeft = '0px';
4038
this._cardsContainer.style.width = this._cards[0].offsetWidth * this._cards.length + 'px';
4139
this._maxPosIndex =
4240
(this._cardsContainer.offsetWidth - this._product_carousel_parent.offsetWidth) /
@@ -45,8 +43,8 @@
4543
this._btnNext.addEventListener('click', e => this._goToNextProductCard());
4644

4745
if (this._minPos >= 0) {
48-
this._btnNext.disabled = true;
49-
this._btnPrev.disabled = true;
46+
this._btnNext.style.display = 'none';
47+
this._btnPrev.style.display = 'none';
5048
} else {
5149
this._btnPrev.disabled = true;
5250
}

0 commit comments

Comments
 (0)