From: Adam Dullage Date: Thu, 17 Feb 2022 18:38:28 +0000 (+0000) Subject: Added Delete Button X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=8d2f874ee8440de4ae0ac99b1c2b16ffc0a1fcf8;p=flatnotes.git Added Delete Button --- diff --git a/README.md b/README.md index 29fb72f..7501db3 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,9 @@ This is what flatnotes aims to achieve. * [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 diff --git a/flatnotes/src/components/App.js b/flatnotes/src/components/App.js index 675517a..2c307a4 100644 --- a/flatnotes/src/components/App.js +++ b/flatnotes/src/components/App.js @@ -229,6 +229,18 @@ export default { 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 ( diff --git a/flatnotes/src/components/App.vue b/flatnotes/src/components/App.vue index b960d40..13f12cb 100644 --- a/flatnotes/src/components/App.vue +++ b/flatnotes/src/components/App.vue @@ -88,6 +88,16 @@ Edit + + +