]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commit
Fix broken back button in tabs with deep linking 6118/head
authorMichael Bromley <michael@michaelbromley.co.uk>
Tue, 16 Dec 2014 13:25:20 +0000 (14:25 +0100)
committerMichael Bromley <michael@michaelbromley.co.uk>
Tue, 16 Dec 2014 13:25:20 +0000 (14:25 +0100)
commit789c6b1324dfa352f96e2324674117caef919b69
tree3fcc1c02ba816403c7fc71230e2b9e118a35c2d5
parentc9be6a22417d5e727c7c67dc5f1305a801d15b67
Fix broken back button in tabs with deep linking

This change fixes a bug in tabs which have deep linking enabled, whereby
the user, in using the browser back button, would only be able to
navigate backwards as far as the default tab hash location. Attempting
to navigate back to the previous page would result in infinite
redirection back to the default tab. For moreinformation see [this
issue](https://github.com/zurb/foundation/issues/6102)

This change has the tab control remember the entry location upon
initialization, and then whenever the hash changes, it compares the
current location.hash value with the entry location and the default hash
value, in order to determine whether to update the location.hash or
simply allow the navigation to occur without modifying the
location.hash.
js/foundation/foundation.tab.js