Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(storefront): BCTHEME-68 Add tooltips for carousel "Previous" and "Next" buttons #1749

Merged
merged 2 commits into from
Aug 26, 2020

Conversation

yurytut1993
Copy link
Contributor

@yurytut1993 yurytut1993 commented Jul 29, 2020

What?

@BC-tymurbiedukhin @bc-alexsaiannyi

Carousel now has arrows with dynamic aria-labels. It tells the user on what exactly slide he will go when click on arrow, and how many slides in carousel. Also refactored code

Tickets / Documentation

Ticket

Screenshots (if appropriate)

left arrow init
left_arrow_4_of_four

right arrow init
right_arrow_2_of_four

left arrow after slide forward
left_arrow_1_of_four

right arrow after slide forward
right_arrow_3_of_four

Also I changed behaviour of products carousel a little bit (at the bottom of the homepage). Now click on arrow triggers moving slides by one. And carousel in a loop now. This is necessary for correct aria-labels of arrows. Or maybe we can use
"Previous" and "Next" for aria-labels in this carousel

product carousel now
multiple_slides_after

product carousel before
multiple_slides_before

@bigbot
Copy link

bigbot commented Jul 29, 2020

Autotagging @bigcommerce/storefront-team @davidchin

templates/components/products/carousel.html Outdated Show resolved Hide resolved
templates/components/products/carousel.html Show resolved Hide resolved
templates/components/products/carousel.html Show resolved Hide resolved
templates/components/carousel.html Show resolved Hide resolved
templates/components/products/carousel.html Outdated Show resolved Hide resolved
templates/components/carousel.html Outdated Show resolved Hide resolved
assets/js/theme/common/carousel.js Show resolved Hide resolved
assets/js/theme/common/carousel.js Show resolved Hide resolved
assets/js/theme/common/carousel.js Outdated Show resolved Hide resolved
templates/components/products/carousel.html Outdated Show resolved Hide resolved
templates/components/carousel.html Outdated Show resolved Hide resolved
templates/components/carousel.html Outdated Show resolved Hide resolved
Comment on lines +24 to +25
if (lastSlide < 2) return;
if ($arrowLeft.length === 0 || $arrowRight.length === 0) return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we concatenate conditions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but in this case I would like to have different conditions, because it is more obvious what cases are unsuitable for continuing function

@BC-tymurbiedukhin BC-tymurbiedukhin merged commit 107b13c into bigcommerce:master Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants