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

Left menu foldable #32

Closed
jordibares opened this issue Mar 20, 2019 · 5 comments
Closed

Left menu foldable #32

jordibares opened this issue Mar 20, 2019 · 5 comments

Comments

@jordibares
Copy link
Contributor

Could we have foldable left menues? when you build a big structure it is rather exhausting to have so much visual noise.

Thanks in advance

@bubbleguuum
Copy link

+1 for this.

@alex-shpak
Copy link
Owner

This requires some nice solution.
Now I try to keep theme functional without JS enabled.

I will check what I can do.

@vhbelvadi
Copy link
Contributor

I managed to achieve this with some jQuery (not sure if it's the best solution). Posting here if anyone is interested/wishes to improve:

In site-level (not theme-level) partial menu-bundle.html replace {{ .Content }} with

{{ .Content | replaceRE "<ul>" "<ul class=\"listing\">" | replaceRE "<li>" "<li class=\"entries\">" | safeHTML }}

Put this in the injected footer:

$(document).ready(function() {
    $('.book-menu ul li.entries').click(function(e) {
      $('.book-menu ul li ul.listing').slideUp();
      $(this).children('.book-menu ul li ul.listing').slideDown();
    });
});

@jordibares
Copy link
Contributor Author

Thanks, will check

@ktibi
Copy link

ktibi commented Feb 12, 2020

@vhbelvadi Hi,

I want to try your solution but I don't understand where I need to add the part of menu-bundle.html.

@alex-shpak Any news for that ?

EDIT: I found the option : bookCollapseSection ! Perfect for me :p

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

5 participants