Track hash changes in session history

Notify history changed on pushState and scroll to frag
This commit is contained in:
Connor Brewster 2018-06-12 22:12:17 +02:00
parent c1cc2aaf9c
commit 61442cce4b
22 changed files with 110 additions and 87 deletions

View file

@ -85,7 +85,10 @@ impl History {
// Step 6
let hash_changed = old_url.fragment() != url.fragment();
// TODO: Step 8 - scroll restoration
// Step 8
if let Some(fragment) = url.fragment() {
document.check_and_scroll_fragment(fragment);
}
// Step 11
let state_changed = state_id != self.state_id.get();