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

Search plugin: add "show-results" class to parent element when showing results #535

Closed
jhildenbiddle opened this issue Jun 10, 2018 · 1 comment

Comments

@jhildenbiddle
Copy link
Member

jhildenbiddle commented Jun 10, 2018

When showing results, the search plugin adds a "show" class to certain elements to change styles. Specifically, it adds the "show" class the the clear button and the results panel:

<div class="search">
  <div class="input-wrap">
    <input type="search" value="" placeholder="Search...">
    <button class="clear-button show" aria-label="Clear search">...</button>
  </div>
  <div class="results-panel show">...</div>
</div>

It would be helpful to have this a class added to the search wrapper as follows:

<div class="search show-results">

Adding this class to the search wrapper will allow the sidebar navigation to be hidden when the search results are displayed using only CSS.

This functionality has been added to docsify-themeable by way of a small plugin, but ideally this would be handled by docsify out-of-the-box. Source code for the plugin can be viewed here:

(Making this change in the docsify source would be much easier than fixing this via plugin).

cheng-kang pushed a commit that referenced this issue Oct 30, 2018
Allow user to configure whether or not to hide other sidebar content while showing searching results.

Related issue: #535
@cheng-kang
Copy link
Contributor

I've raised a PR for adding a new option hideSidebarOtherContent to search plugin.

I wouldn't call it a bug though. This is a nice new feature. Hope it satisfies your need.

QingWei-Li pushed a commit that referenced this issue Oct 31, 2018
Allow user to configure whether or not to hide other sidebar content while showing searching results.

Related issue: #535
QingWei-Li pushed a commit that referenced this issue Oct 31, 2018
Allow user to configure whether or not to hide other sidebar content while showing searching results.

Related issue: #535
@jhildenbiddle jhildenbiddle changed the title Search plugin: add "show" class to parent element when showing results Search plugin: add "show-results" class to parent element when showing results Nov 2, 2018
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

No branches or pull requests

3 participants