Skip to content

Commit

Permalink
feat: Add sidebar button to navigation
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Feb 24, 2023
1 parent b5c7a99 commit 997b8a4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/NavigationNoteItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
<NcActionButton :icon="actionFavoriteIcon" @click="onToggleFavorite">
{{ actionFavoriteText }}
</NcActionButton>
<NcActionButton icon="icon-details" @click="onToggleSidebar">
<SidebarIcon slot="icon" :size="20" />
{{ t('notes', 'Details') }}
</NcActionButton>
<NcActionButton v-if="!note.readonly" :icon="actionDeleteIcon" @click="onDeleteNote">
{{ t('notes', 'Delete note') }}
</NcActionButton>
Expand All @@ -32,7 +36,9 @@ import {
NcActionSeparator,
NcAppNavigationItem,
} from '@nextcloud/vue'
import SidebarIcon from 'vue-material-design-icons/PageLayoutSidebarRight.vue'
import { showError } from '@nextcloud/dialogs'
import store from '../store.js'
import { setFavorite, setTitle, fetchNote, deleteNote } from '../NotesService.js'
import { categoryLabel, routeIsNewNote } from '../Util.js'
Expand All @@ -44,6 +50,7 @@ export default {
NcActionButton,
NcActionSeparator,
NcAppNavigationItem,
SidebarIcon,
},
props: {
Expand Down Expand Up @@ -117,6 +124,11 @@ export default {
this.$emit('category-selected', this.note.category)
},
onToggleSidebar() {
this.actionsOpen = false
store.commit('setSidebarOpen', !store.state.app.sidebarOpen)
},
onRename(newTitle) {
this.loading.note = true
setTitle(this.note.id, newTitle)
Expand Down

0 comments on commit 997b8a4

Please sign in to comment.