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 1 commit
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
7 changes: 7 additions & 0 deletions src/components/NcAppNavigationItem/NcAppNavigationItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,13 @@
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

Check failure on line 700 in src/components/NcAppNavigationItem/NcAppNavigationItem.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Expected space or tab after '//' in comment
GVodyanov marked this conversation as resolved.
Show resolved Hide resolved
if (this.to === null && this.href === null && this.collapsible === true) {
this.open = !this.open

Check failure on line 702 in src/components/NcAppNavigationItem/NcAppNavigationItem.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected mutation of "open" prop
GVodyanov marked this conversation as resolved.
Show resolved Hide resolved
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.

}

Check failure on line 705 in src/components/NcAppNavigationItem/NcAppNavigationItem.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Trailing spaces not allowed
GVodyanov marked this conversation as resolved.
Show resolved Hide resolved
// 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