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

Add an option to auto-slide right only #1437

Merged
merged 3 commits into from
Nov 19, 2015
Merged

Add an option to auto-slide right only #1437

merged 3 commits into from
Nov 19, 2015

Conversation

MichiK
Copy link
Contributor

@MichiK MichiK commented Nov 18, 2015

I needed to prepare a presentation that runs automatically in an infinite loop with a few "bonus slides" that further explain certain topics within the presentation. However, auto-sliding per default always navigates to the next slide which may be below the current one.

With the autoSlideRight option enabled, auto-sliding will ignore the basement levels and always navigate to the right. However, the user can always intervene and seamlessly bring up the additional slides with the bonus content.

When the autoSlideRight config option is active, the auto-sliding
will always navigate to the right and never down even if slides are
present there. This allows hidden "bonus slides" in presentations
which can be displayed as needed but won't show up automatically.
@hakimel
Copy link
Owner

hakimel commented Nov 19, 2015

Thanks for the PR. This is an interesting idea, though I think it could be made a bit more flexible. What if we made the config option autoSlideMethod instead so you can switch to any navigation method?

// Only step to the right
Reveal.initialize({ autoSlideMethod: Reveal.navigateRight })

// Go backwards
Reveal.initialize({ autoSlideMethod: Reveal.navigatePrev })

// Go backwards
Reveal.initialize({ autoSlideMethod: function() {
  // custom behavior
} })

Would be pretty straight forward to add, we just need to replace navigateNext here and make sure it defaults to using navigateNext: https://github.com/hakimel/reveal.js/blob/master/js/reveal.js#L3691

Auto-sliding will now use the method specified in the config if it is
a function or default to navigateNext.
@MichiK
Copy link
Contributor Author

MichiK commented Nov 19, 2015

Maybe like this?

hakimel added a commit that referenced this pull request Nov 19, 2015
Add an option to auto-slide right only
@hakimel hakimel merged commit bbe38ad into hakimel:dev Nov 19, 2015
@hakimel
Copy link
Owner

hakimel commented Nov 19, 2015

That's great – thanks!

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.

None yet

2 participants