* [x] Ability to Rename a Note
* [x] Routing
* [x] e to edit
+* [x] Ability to Delete a Note
+* [ ] Exclude extension when renaming
* [ ] Loading & Not Found Indicators
-* [ ] Ability to Delete a Note
* [ ] / to search
* [ ] CTRL-S to save
* [ ] Drafts
this.toggleEditMode();
},
+ deleteNote: function() {
+ if (
+ confirm(
+ `Are you sure you want to delete the note '${this.currentNote.title}'?`
+ )
+ ) {
+ api
+ .delete(`/api/notes/${this.currentNote.filename}`)
+ .then(window.open("/", "_self"));
+ }
+ },
+
keyboardShortcuts: function(e) {
// 'e' to Edit
if (
Edit
</button>
+ <!-- Delete -->
+ <button
+ v-if="currentView == views.note && editMode == false"
+ type="button"
+ class="btn btn-danger mx-1"
+ @click="deleteNote"
+ >
+ Delete
+ </button>
+
<!-- Cancel -->
<button
v-if="currentView == views.note && editMode == true"