File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 55
66<template >
77 <Fragment >
8+ <NcButton @click =" onToggleNotesList" >
9+ {{ t('notes', 'Toggle Notes List') }}
10+ </NcButton >
811 <NcAppNavigationItem
912 :name =" t('notes', 'All notes')"
1013 :class =" { active: selectedCategory === null }"
@@ -47,6 +50,7 @@ import {
4750 NcAppNavigationItem ,
4851 NcAppNavigationCaption ,
4952 NcCounterBubble ,
53+ NcButton ,
5054} from ' @nextcloud/vue'
5155import { Fragment } from ' vue-frag'
5256
@@ -65,6 +69,7 @@ export default {
6569 Fragment,
6670 NcAppNavigationItem,
6771 NcAppNavigationCaption,
72+ NcButton,
6873 NcCounterBubble,
6974 FolderIcon,
7075 FolderOutlineIcon,
@@ -83,9 +88,16 @@ export default {
8388 selectedCategory () {
8489 return store .getters .getSelectedCategory ()
8590 },
91+ toggleNotesList () {
92+ return store .getters .getToggleNotesList ()
93+ },
8694 },
8795
8896 methods: {
97+ onToggleNotesList () {
98+ store .commit (' setToggleNotesList' , ! this .toggleNotesList )
99+ },
100+
89101 categoryTitle (category ) {
90102 return categoryLabel (category)
91103 },
Original file line number Diff line number Diff line change 66<template >
77 <NcAppContent pane-config-key =" note" :show-details =" showNote" @update:showDetails =" hideNote" >
88 <template slot="list">
9- <NcAppContentList class =" content-list" >
9+ <NcAppContentList v-if = " !showNotesList " class =" content-list" >
1010 <div class =" content-list__search" >
1111 <NcTextField
1212 :value.sync =" searchText"
5959</template >
6060
6161<script >
62-
6362import {
6463 NcAppContent ,
6564 NcAppContentList ,
@@ -131,6 +130,9 @@ export default {
131130 return this .filteredNotes
132131 }
133132 },
133+ showNotesList () {
134+ return store .state .app .toggleNotesList
135+ },
134136
135137 // group notes by time ("All notes") or by category (if category chosen)
136138 groupedNotes () {
Original file line number Diff line number Diff line change @@ -11,9 +11,13 @@ const state = {
1111 isManualSave : false ,
1212 documentTitle : null ,
1313 searchText : '' ,
14+ toggleNotesList : false ,
1415}
1516
1617const getters = {
18+ getToggleNotesList : ( state ) => ( ) => {
19+ return state . toggleNotesList
20+ } ,
1721}
1822
1923const mutations = {
@@ -40,6 +44,10 @@ const mutations = {
4044 updateSearchText ( state , searchText ) {
4145 state . searchText = searchText
4246 } ,
47+
48+ setToggleNotesList ( state , value ) {
49+ state . toggleNotesList = value
50+ } ,
4351}
4452
4553const actions = {
You can’t perform that action at this time.
0 commit comments