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

Automatically expand footnote when referenced in URL hash fragment #356

Open
inwardmovement opened this issue Jun 16, 2020 · 1 comment
Open
Labels

Comments

@inwardmovement
Copy link

Can you add a feature to update the URL when we click on a footnote reference, just as footnotes links does (#fn:1) ? So we can deeplink to the footnote/popover.

@goblindegook
Copy link
Owner

Been giving this some thought and it's not as straighforward as it seems, especially since littlefoot allows you to activate multiple popovers concurrently as well as opening them on hover. I feel like this is a feature best left to individual developers to implement through activateCallback and not built into the library:

littlefoot({
  activateCallback: (popover) => {
    window.location.hash = '#' + popover.id
  }
})

It probably still makes sense to automatically expand a popover if its ID is referenced in the fragment when you open the page so I'll keep the issue open for that.

@goblindegook goblindegook changed the title Update url on target Automatically expand footnote when referenced in URL hash fragment Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants