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

[END] key bug #3007

Closed
lokpro opened this issue Sep 14, 2021 · 4 comments
Closed

[END] key bug #3007

lokpro opened this issue Sep 14, 2021 · 4 comments

Comments

@lokpro
Copy link

lokpro commented Sep 14, 2021

Pressing the [END] key should go to the last slide, but the current code doesn't work.
It won't go to my last slide (11) but to number 4. It seems like the number param is taken modulus to be the slide number.

this.Reveal.slide( Number.MAX_VALUE );

shift+➜ too,

this.Reveal.slide( Number.MAX_VALUE );

should be something like

Reveal.slide( Reveal.getSlides().length-1 );
@hakimel
Copy link
Owner

hakimel commented Sep 15, 2021

Is this in a presentation with vertical slides? Any chance you could share a link to it? I tried out Reveal.slide( Number.MAX_VALUE ) but it took me to the correct slide in the presentations I used.

@lokpro
Copy link
Author

lokpro commented Sep 15, 2021

I found out that with loop=true, numbers larger than total slides will jump back around. That's why MAX_VALUE is not going to the last slide.

@lokpro
Copy link
Author

lokpro commented Sep 15, 2021

Reveal.slide(
   lastIndexOfHSlides, 
   lastIndexOfVSlides,
   lastIndexOfFragments,
);

might be something like this.

// or Just an idea, a 3-step [END], [END], [END]

Reveal.slide(
   lastIndexOfHSlides,
   isAlreadyOnLastHSlide ? lastIndexOfVSlides : 0,
   isAlreadyOnLastHSlide && isAlreadyOnLastVSlide ? lastIndexOfFragments : 0,
);

@hakimel
Copy link
Owner

hakimel commented Sep 16, 2021

This has been fixed now. Shortcuts for jumping to the last slide now work correctly even if the presentation is looped.

@hakimel hakimel closed this as completed Sep 16, 2021
fab4100 pushed a commit to fab4100/reveal.js that referenced this issue Oct 1, 2021
srwohl pushed a commit to srwohl/phantom-pres that referenced this issue Sep 2, 2024
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

No branches or pull requests

2 participants