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

Docs and examples switching retains filter #22507

Merged
merged 6 commits into from
Sep 10, 2021
Merged

Conversation

octopoulos
Copy link
Contributor

@octopoulos octopoulos commented Sep 8, 2021

For example, if you search for "fog" in the examples, then click on "docs" link, the filter is emptied and it shows "Create a scene" page.
Same thing if you search in docs and click on the examples link.

With this PR, the search is retained, which personally helps me a lot.
Typical scenario is:

  • Let's see if there are examples of ... parametric, so I type "param", cool I see an example.
  • Now let's see if there's any doc about it, so I click on the docs link, then: "arghh, I have to type it again!!"
    :)

Screenshots:

  1. write "skin"
    image

  2. click on docs and this appears:
    image

  3. click again on examples and this appears:
    image

@octopoulos
Copy link
Contributor Author

I was using a sort of a non standard way to store the original href, with sectionLink.href2 = ... instead of using a dataset or setAttribute, which personally I don't mind doing at all, but after looking at the existing code, I realized the coding style was different, so I made some changes, and removed that href2 "hack", and instead I'm storing the original href value in a variable, that's it!

The functionality has not changed.

@mrdoob
Copy link
Owner

mrdoob commented Sep 10, 2021

so I made some changes, and removed that href2 "hack"

Nice, I was going to mention that 🤓

@mrdoob
Copy link
Owner

mrdoob commented Sep 10, 2021

@mrdoob mrdoob added this to the r133 milestone Sep 10, 2021
@mrdoob mrdoob merged commit 3877bba into mrdoob:dev Sep 10, 2021
@mrdoob
Copy link
Owner

mrdoob commented Sep 10, 2021

Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Sep 10, 2021

We'll have to unify all that duplicated code from examples/index.html and docs/index.html some day...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants