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

Collapse and Expand VerticalNav through code #438

Closed
urdeveloper opened this issue Aug 4, 2018 · 5 comments
Closed

Collapse and Expand VerticalNav through code #438

urdeveloper opened this issue Aug 4, 2018 · 5 comments

Comments

@urdeveloper
Copy link

I was wondering if there's a way to collapse and expand the VerticalNav through the code. Right now it's only possible by clicking on humbugger menu.

I noticed there are two methods (expandMenu and CollapseMenu) but both are private:

Will be happy to send a PR if you're willing to make the methods public.

@dlabrecq
Copy link
Member

dlabrecq commented Aug 6, 2018

I don't have an issue making these methods public. However, I would like to first understand why you need to open/close the menu programmatically?

@urdeveloper
Copy link
Author

The use case is to persist the NavBar state (collapsed/expanded) so the user won't need to collapse the NavBar every time the page reloads.
Please see the PatternFly example , collapse the menu and refresh the page.

@dlabrecq
Copy link
Member

dlabrecq commented Aug 6, 2018

I'm wondering if we can provide an attribute to set the initial state? We already use an internal property we could expose. Something like:

<pfng-vertical-navigation [explicitCollapse]="true"...

That way the menu renders collapsed instead of forcing it to close after briefly shown open? This would also allow the mobile state to override that.

Or would you prefer to call the methods instead?

@urdeveloper
Copy link
Author

That would do it. Thanks!

@dlabrecq
Copy link
Member

dlabrecq commented Aug 7, 2018

I added a new showMenuCollapsed attribute.

#441

@dlabrecq dlabrecq closed this as completed Aug 8, 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

2 participants