Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions src/components/CategoriesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

<template>
<Fragment>
<NcButton @click="onToggleNotesList">
{{ t('notes', 'Toggle Notes List') }}
</NcButton>
<NcAppNavigationItem
:name="t('notes', 'All notes')"
:class="{ active: selectedCategory === null }"
Expand Down Expand Up @@ -47,6 +50,7 @@ import {
NcAppNavigationItem,
NcAppNavigationCaption,
NcCounterBubble,
NcButton,
} from '@nextcloud/vue'
import { Fragment } from 'vue-frag'

Expand All @@ -65,6 +69,7 @@ export default {
Fragment,
NcAppNavigationItem,
NcAppNavigationCaption,
NcButton,
NcCounterBubble,
FolderIcon,
FolderOutlineIcon,
Expand All @@ -83,9 +88,16 @@ export default {
selectedCategory() {
return store.getters.getSelectedCategory()
},
toggleNotesList() {
return store.getters.getToggleNotesList()
},
},

methods: {
onToggleNotesList() {
store.commit('setToggleNotesList', !this.toggleNotesList)
},

categoryTitle(category) {
return categoryLabel(category)
},
Expand Down
6 changes: 4 additions & 2 deletions src/components/NotesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<template>
<NcAppContent pane-config-key="note" :show-details="showNote" @update:showDetails="hideNote">
<template slot="list">
<NcAppContentList class="content-list">
<NcAppContentList v-if="!showNotesList" class="content-list">
<div class="content-list__search">
<NcTextField
:value.sync="searchText"
Expand Down Expand Up @@ -59,7 +59,6 @@
</template>

<script>

import {
NcAppContent,
NcAppContentList,
Expand Down Expand Up @@ -131,6 +130,9 @@ export default {
return this.filteredNotes
}
},
showNotesList() {
return store.state.app.toggleNotesList
},

// group notes by time ("All notes") or by category (if category chosen)
groupedNotes() {
Expand Down
8 changes: 8 additions & 0 deletions src/store/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ const state = {
isManualSave: false,
documentTitle: null,
searchText: '',
toggleNotesList: false,
}

const getters = {
getToggleNotesList: (state) => () => {
return state.toggleNotesList
},
}

const mutations = {
Expand All @@ -40,6 +44,10 @@ const mutations = {
updateSearchText(state, searchText) {
state.searchText = searchText
},

setToggleNotesList(state, value) {
state.toggleNotesList = value
},
}

const actions = {
Expand Down