From 2e93c331848c92c23eb6466adce74fd287095f41 Mon Sep 17 00:00:00 2001 From: Grigory Vodyanov Date: Fri, 4 Oct 2024 17:59:50 +0200 Subject: [PATCH 1/4] feat(NcAppNavigationItem): make collapsible by clicking on whole component Signed-off-by: Grigory Vodyanov --- src/components/NcAppNavigationItem/NcAppNavigationItem.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue index e6169da168..515d54ed04 100644 --- a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue +++ b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue @@ -696,6 +696,13 @@ 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.open = !this.open + event.preventDefault() + } + // Do not navigate with control keys - it is opening in a new tab if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) { return From 0780ed6e6c41b46777cf38e2d634e7b27c491c3c Mon Sep 17 00:00:00 2001 From: Grigory Vodyanov Date: Mon, 7 Oct 2024 17:28:52 +0200 Subject: [PATCH 2/4] Update src/components/NcAppNavigationItem/NcAppNavigationItem.vue Co-authored-by: Ferdinand Thiessen Signed-off-by: Grigory Vodyanov --- src/components/NcAppNavigationItem/NcAppNavigationItem.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue index 515d54ed04..0609436ff1 100644 --- a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue +++ b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue @@ -697,7 +697,7 @@ export default { // Always forward native event this.$emit('click', event) - //If no links are defined, and collapsing is enabled, we want it to collapse + // 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.open = !this.open event.preventDefault() From 7c0f09de74004a9b7323ee899d9e42b35333e3f1 Mon Sep 17 00:00:00 2001 From: Grigory Vodyanov Date: Mon, 7 Oct 2024 17:29:19 +0200 Subject: [PATCH 3/4] Update src/components/NcAppNavigationItem/NcAppNavigationItem.vue Co-authored-by: Ferdinand Thiessen Signed-off-by: Grigory Vodyanov --- src/components/NcAppNavigationItem/NcAppNavigationItem.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue index 0609436ff1..f02d9f66e1 100644 --- a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue +++ b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue @@ -702,7 +702,6 @@ export default { this.open = !this.open event.preventDefault() } - // Do not navigate with control keys - it is opening in a new tab if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) { return From 3a2f22fb03f5f95bcde6e092b5f179caedc8ff0f Mon Sep 17 00:00:00 2001 From: Grigory Vodyanov Date: Mon, 7 Oct 2024 17:29:34 +0200 Subject: [PATCH 4/4] Update src/components/NcAppNavigationItem/NcAppNavigationItem.vue Co-authored-by: Ferdinand Thiessen Signed-off-by: Grigory Vodyanov --- src/components/NcAppNavigationItem/NcAppNavigationItem.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue index f02d9f66e1..123cb19ba0 100644 --- a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue +++ b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue @@ -699,7 +699,7 @@ export default { // 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.open = !this.open + this.toggleCollapse() event.preventDefault() } // Do not navigate with control keys - it is opening in a new tab