Skip to content

Commit e6c39a7

Browse files
committed
filter collections WIP
1 parent f58806c commit e6c39a7

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/components/documents.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<h3 style="margin-top: 0;">Your Collections: </h3>
88
<button @click="newCollection" class="button warning full-width">New Collection</button>
99
</div>
10-
<div class="collection" v-for="collection in collections" :key="collection.key">
10+
<div @click="filterBy(collection)" class="collection" v-for="collection in collections" :key="collection.key">
1111
<hr class="collection-rule">
1212
<div class="fab-container">
1313
<h5>{{collection.name}}</h5>
@@ -113,7 +113,8 @@ export default {
113113
collectionsOpen: false,
114114
addToCollectionModal: false,
115115
addDoc: false,
116-
collectionToAdd: null
116+
collectionToAdd: null,
117+
collectionFilter: false
117118
}),
118119
created() {
119120
document.title = `Graphite Writer BETA v${
@@ -205,11 +206,17 @@ export default {
205206
.includes(query);
206207
}
207208
};
208-
return result.filter(filter);
209+
if (this.collectionFilter) {
210+
} else {
211+
return result.filter(filter);
212+
}
209213
}
210214
}
211215
},
212216
methods: {
217+
filterBy(collection) {
218+
this.collectionFilter = collection.key;
219+
},
213220
addDocToCollection() {
214221
let docId = this.addDoc.userData.key;
215222
let userId = this.addDoc.userData.uid;

0 commit comments

Comments
 (0)