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

Slide Permalink Is Not Exposed Anywhere if replaceState Is Not Supported #50

Open
banksJeremy opened this issue Jun 8, 2012 · 0 comments

Comments

@banksJeremy
Copy link
Collaborator

The Butter editor is unusable in IE9, but the only issue I could find in exported HTML-only presentations was this.

The deck.hash.js plugin only updates the current URL when switching slides if the history.replaceState function is available. (It will be in IE10, but it's not in IE9.) Otherwise, it only updates the permalink displayed on the page.

The issue is that we don't have a permalink displayed on the page anywhere, so the permalink of the current slide isn't exposed anywhere for IE9 users. The plugin expects us to have one, and it will hide it for browsers that support replaceState.

We should probably just add a visible link, but I was thinking about the problem of getting the same behaviour in IE9.

Presumably they're insisting on replaceState because they don't want to pollute the browser history with slides. I think it would be possible to get the expected changing URL in IE9 without breaking the back button, at the expense of having three events listed in the history.

  • When the page loads, set location.hash = "#__BACK__", then set location.hash = "#"
  • If the navigates to #__BACK__ (by pressing their back button), trigger history.go(-2) to get them off of our page as they probably intend.
  • When the slide changes, use history.back() to remove our current hash from the history and return to __BACK__, then add the new new hash to the URL. (Giving us the same behaviour as if we used replaceState, just requiring an extra history event as a buffer, which must come after the first history event from when the page loaded.)
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

1 participant