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

Hide single dot #206

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ominiverdi
Copy link

Don't show a single dot. Avoid generating it.

Copy link
Owner

@NickPiscitelli NickPiscitelli left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for the fix, this looks good. Are you able to make the small adjustment and submit back?

@@ -210,6 +208,10 @@
_.dots.innerHTML = ''
_.dots.classList.add('glider-dots')

//hide single dot
if (Math.ceil(_.slides.length / _.opt.slidesToShow) == 1) return;
Copy link
Owner

Choose a reason for hiding this comment

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

Store this to a variable and then use it later in the loop to prevent the redundant calculation

Copy link
Author

Choose a reason for hiding this comment

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

HI Nick, thanks for considering my contribution.

Let's see if I understand it right.

Are you asking something like:

var dots = Math.ceil(_.slides.length / _.opt.slidesToShow)
if(dots==1) return
for (var i = 0; i < dots; ++i) {

Is that the change you are asking for?

regards
Lorenzo

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.

2 participants