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

feat(NcAppNavigationItem): make collapsible by clicking on whole component #6131

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/NcAppNavigationItem/NcAppNavigationItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,12 @@ export default {
onClick(event, navigate, routerLinkHref) {
// Always forward native event
this.$emit('click', event)

// If no links are defined, and collapsing is enabled, we want it to collapse
if (this.to === null && this.href === null && this.collapsible === true) {
this.toggleCollapse()
event.preventDefault()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@susnux Sorry for the late reply, but it is needed because there are multiple actions that clicking an AppNavigationItem could trigger. If a link is defined, you go to the link, if not and the component is collapsible, it would collapse.

}
// Do not navigate with control keys - it is opening in a new tab
if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) {
return
Expand Down
Loading