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

URLs with fragment online are not properly working inside ZIM UI #38

Open
benoit74 opened this issue Oct 25, 2024 · 2 comments
Open

URLs with fragment online are not properly working inside ZIM UI #38

benoit74 opened this issue Oct 25, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@benoit74
Copy link
Contributor

benoit74 commented Oct 25, 2024

Since Vue.JS using is already using the fragment to indicate the URL to load inside the Vue Router, we cannot use the fragment a second time (or at least it is intercepted by the Vue application and / or not properly passed to the browser to scroll to the corresponding anchor).

We should adapt accordingly and transform the fragment into something processable by the Vue application (pretty easy to pass the information to Vue with for instance a query parameter in the URL instead of a fragment, but I have no idea how to scroll properly afterwards, to be investigated)

@benoit74 benoit74 added the bug Something isn't working label Oct 25, 2024
@benoit74 benoit74 added this to the later milestone Oct 25, 2024
@benoit74
Copy link
Contributor Author

We could also add some CSS to enhance visibility with something like:

  text-decoration-color: #0372a6;
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 2px;

And scrolling into view is just a matter of calling scrollIntoView:

var element_to_scroll_to = document.getElementById('anchorName2');
// Or:
var element_to_scroll_to = document.querySelectorAll('.my-element-class')[0];
// Or:
var element_to_scroll_to = $('.my-element-class')[0];
// Basically `element_to_scroll_to` just have to be a reference
// to any DOM element present on the page
// Then:
element_to_scroll_to.scrollIntoView();

@benoit74 benoit74 self-assigned this Oct 25, 2024
@benoit74
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant