Skip to content

Commit

Permalink
sidebar: allow turning off tags view by default
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
  • Loading branch information
solracsf authored Jul 5, 2024
1 parent 802ef3c commit 2868936
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions apps/files/src/views/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<!-- TODO: create a standard to allow multiple elements here? -->
<template v-if="fileInfo" #description>
<div class="sidebar__description">
<SystemTags v-if="isSystemTagsEnabled"
<SystemTags v-if="isSystemTagsEnabled && showTagsDefault"
v-show="showTags"
:file-id="fileInfo.id"
@has-tags="value => showTags = value" />
Expand Down Expand Up @@ -158,6 +158,7 @@ export default {
// reactive state
Sidebar: OCA.Files.Sidebar.state,
showTags: false,
showTagsDefault: true,
error: null,
loading: true,
fileInfo: null,
Expand Down Expand Up @@ -445,7 +446,7 @@ export default {
* Toggle the tags selector
*/
toggleTags() {
this.showTags = !this.showTags
this.showTagsDefault = this.showTags = !this.showTags
},

/**
Expand Down Expand Up @@ -537,6 +538,15 @@ export default {
}
},

/**
* Allow to set whether tags should be shown by default from OCA.Files.Sidebar
*
* @param {boolean} showTagsDefault - Whether or not to show the tags by default.
*/
setShowTagsDefault(showTagsDefault) {
this.showTagsDefault = showTagsDefault
},

/**
* Emit SideBar events.
*/
Expand Down

0 comments on commit 2868936

Please sign in to comment.