Navigating to local URL fragment doesn't modify browser history

I implemented a work-around (arguably a proper approach to customize a site given Discourse’s point-of-view on link navigation) via a theme component. This follows the pattern used by DiscoTOC where a marker is added to a post to trigger the behavior. The applicable code is here.

I think modifying DiscoTOC to use URL fragments and browser history is a good idea. This requires changing the component’s approach to navigation, which is not a minor change. DiscoTOC uses data attributes to pass along targets rather than link href’s. There’s no attempt to reflect the new page location in the browser URL (window.location).

I think the pattern I’m using above could work for DiscoTOC but that has broader implications for that component given its current approach.

2 « J'aime »