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

Fixed not bing able to follow same inner links twice with history:false #2350

Merged
merged 2 commits into from
Mar 21, 2019

Conversation

rparree
Copy link
Contributor

@rparree rparree commented Mar 15, 2019

Scenario:

  • history set to false in Reveal’s config
  • follow anchor to /#someid
  • navigate to other sections
  • follow anchor to same section /#someid

This does not work as the hash has not changed.

This fix removes the hash from the URL when navigating

Scenario:

- history set to false in Reveal’s config
- follow anchor to `/#someid`
- navigate to other sections
- follow anchor to same section `/#someid`

This does not work as the hash has not changed.

This fix removes the hash from the URL when navigating
@hakimel hakimel changed the base branch from master to dev March 21, 2019 07:59
@hakimel hakimel merged commit ae556d0 into hakimel:dev Mar 21, 2019
hakimel added a commit that referenced this pull request Mar 21, 2019
@hakimel
Copy link
Owner

hakimel commented Mar 21, 2019

Thanks for the patch! I've merged this but hade to make some changes to make it play well with some newer code in the dev branch.

@rparree
Copy link
Contributor Author

rparree commented Apr 2, 2019

For some reason when i was testing this it was working, but i am now using it in a production piece and it does not work. Changing the hash triggers a slide change.

Using the following code instead seems to do the trick:

history.pushState("", document.title, window.location.pathname + window.location.search);

See also https://github.com/rparree/reveal.js/blob/hash-problem/js/reveal.js

Shall i make another pull request?

@hakimel
Copy link
Owner

hakimel commented Apr 3, 2019

Hm, I tested this again with the 3.8.0 release but from what I can tell your original fix is working. Any chance you can include a sample presentation where the same link can't be followed twice?

@rparree
Copy link
Contributor Author

rparree commented Apr 5, 2019

I tested it with 3.8.0 and it works, so no need for another pull request. I have deleted my branch meanwhile.

tx.,

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