You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
When going from multi-page template to a new single page and then back does not behave as expected.
For instance in the example below, if you click "show single page" link from Page 3 and try to go back, you would need to click back 2 times with no result and then after 3rd click you would be taken to Page 1 (beta 2 and 3).
This was actually a bug that was introduced in Beta 2 when we decided that relative URLs should be resolved against the path for the current page. What's basically happening here is that our hashchange callback is only passing the hash for embedded pages to changePage(). So for example in this particular case it is calling changePage("#page3") which in turn gets resolved to single.html#page3, because single.html is the current page showing, when it should be index.html#page3.
The simple fix for this is to pass the entire location.href from the hashchange callback, that way there is no ambiguity.
Ok, turns out there were actually 2 problems. One was the problem I mentioned above, which was an easy fix. The 2nd was a little tougher to figure out, but when push-state is turned on, the hashchange event is not fired when doing a window.history.back() from an external URL to an embedded page.
I have a fix for both. I'm currently running the unit tests.
When going from multi-page template to a new single page and then back does not behave as expected.
For instance in the example below, if you click "show single page" link from Page 3 and try to go back, you would need to click back 2 times with no result and then after 3rd click you would be taken to Page 1 (beta 2 and 3).
The text was updated successfully, but these errors were encountered: