From: Adam Dullage Date: Wed, 29 Jun 2022 05:47:13 +0000 (+0100) Subject: Moved recently modified to a component X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=e417c71e474eaa053725047fe316a924cdcb1bfa;p=flatnotes.git Moved recently modified to a component --- diff --git a/flatnotes/src/components/App.js b/flatnotes/src/components/App.js index 9715556..64f2220 100644 --- a/flatnotes/src/components/App.js +++ b/flatnotes/src/components/App.js @@ -1,6 +1,8 @@ import { Editor } from "@toast-ui/vue-editor"; import { Viewer } from "@toast-ui/vue-editor"; +import RecentlyModified from "./RecentlyModified"; + import api from "../api"; import * as constants from "../constants"; import { Note, SearchResult } from "./classes"; @@ -11,6 +13,7 @@ export default { components: { Viewer, Editor, + RecentlyModified, }, data: function() { @@ -24,7 +27,6 @@ export default { // Home Page if (basePath == "") { - this.getNotes(5, "lastModified", "desc"); this.currentView = this.views.home; } @@ -116,20 +118,6 @@ export default { this.navigate(`/${constants.basePaths.login}`); }, - getNotes: function(limit = null, sort = "filename", order = "asc") { - let parent = this; - api - .get("/api/notes", { - params: { limit: limit, sort: sort, order: order }, - }) - .then(function(response) { - parent.notes = []; - response.data.forEach(function(note) { - parent.notes.push(new Note(note.filename, note.lastModified)); - }); - }); - }, - search: function() { this.navigate( `/${constants.basePaths.search}?${ diff --git a/flatnotes/src/components/App.vue b/flatnotes/src/components/App.vue index 2cf3146..b8f9163 100644 --- a/flatnotes/src/components/App.vue +++ b/flatnotes/src/components/App.vue @@ -216,30 +216,7 @@ -
- -
-

Loading...

-
- - -
-

No Notes

-
- - -
- -
-
+ diff --git a/flatnotes/src/components/RecentlyModified.vue b/flatnotes/src/components/RecentlyModified.vue new file mode 100644 index 0000000..4e21960 --- /dev/null +++ b/flatnotes/src/components/RecentlyModified.vue @@ -0,0 +1,66 @@ + + + \ No newline at end of file diff --git a/flatnotes/src/constants.js b/flatnotes/src/constants.js index 4fb6eda..a4c4918 100644 --- a/flatnotes/src/constants.js +++ b/flatnotes/src/constants.js @@ -30,7 +30,6 @@ export const dataDefaults = function() { rememberMeInput: false, // Note Data - notes: null, searchTerm: null, searchResults: null, currentNote: null,