Skip to content

Commit

Permalink
Merge pull request #5702 from nextcloud-libraries/feat/NcAppSidebar--…
Browse files Browse the repository at this point in the history
…no-toggle

feat(NcAppSidebar): add noToggle prop to hide the built-in toggle button
  • Loading branch information
susnux authored Jun 13, 2024
2 parents 5fa538a + c4349b0 commit bb79505
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/NcAppSidebar/NcAppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export default {
<template>
<Fragment>
<!-- With vue3 we can move this inside the transition, but vue2 does not allow v-show in transition -->
<NcButton v-if="!open"
<NcButton v-if="!open && !noToggle"
:aria-label="t('Open sidebar')"
class="app-sidebar__toggle"
:class="toggleClasses"
Expand Down Expand Up @@ -763,10 +763,10 @@ export default {
/**
* Allow to conditionally show the sidebar
* You can also use `v-if` on the sidebar, but using the open prop allow to keep
* the sidebar inside the DOM for performance if it is opened and closed multple times.
* the sidebar inside the DOM for performance if it is opened and closed multiple times.
*
* When using the `open` property to close the sidebar a built-in toggle button will be shown to reopen it,
* similar to the app navigation.
* similar to the app navigation. You can remove this button with the `no-toggle` prop.
*/
open: {
type: Boolean,
Expand All @@ -789,6 +789,14 @@ export default {
type: Object,
default: undefined,
},
/**
* Do not add the built-in toggle button with `open` prop.
*/
noToggle: {
type: Boolean,
default: false,
},
},
emits: [
Expand Down

0 comments on commit bb79505

Please sign in to comment.