diff --git a/src/digimarks/main.py b/src/digimarks/main.py index b451c23..d53f757 100644 --- a/src/digimarks/main.py +++ b/src/digimarks/main.py @@ -34,6 +34,8 @@ class Settings(BaseSettings): favicons_dir: DirectoryPath # inside the codebase + # static_dir: DirectoryPath = Path('digimarks/static') + # template_dir: DirectoryPath = Path('digimarks/templates') static_dir: DirectoryPath = 'digimarks/static' template_dir: DirectoryPath = 'digimarks/templates' diff --git a/src/digimarks/static/js/digimarks.js b/src/digimarks/static/js/digimarks.js index bd902eb..d15b6fc 100644 --- a/src/digimarks/static/js/digimarks.js +++ b/src/digimarks/static/js/digimarks.js @@ -18,6 +18,7 @@ document.addEventListener('alpine:init', () => { /* Bookmark that is being edited, used to fill the form, etc. */ bookmarkToEdit: Alpine.$persist({}).as('bookmarkToEdit'), bookmarkToEditError: null, + bookmarkToEditVisible: false, /* Loading indicator */ loading: false, @@ -147,6 +148,10 @@ document.addEventListener('alpine:init', () => { ) }, get filteredTags() { + if (this.cache[this.userKey].tags === undefined) { + console.log('Tags not yet cached'); + return []; + } /* Search in the list of all tags */ return this.cache[this.userKey].tags.filter( i => i.match(new RegExp(this.search, "i")) @@ -214,7 +219,6 @@ document.addEventListener('alpine:init', () => { 'note': '', 'tags': '' } - }, async startAddingBookmark() { /* Open 'add bookmark' page */ @@ -222,6 +226,7 @@ document.addEventListener('alpine:init', () => { this.resetEditBookmark(); // this.show_bookmark_details = true; const editFormDialog = document.getElementById("editFormDialog"); + this.bookmarkToEditVisible = true; editFormDialog.showModal(); }, async bookmarkURLChanged() { @@ -253,6 +258,7 @@ document.addEventListener('alpine:init', () => { }, async saveBookmark() { console.log('Saving bookmark'); + // this.bookmarkToEditVisible = false; // this.show_bookmark_details = false; }, async addBookmark() { diff --git a/src/digimarks/templates/user_index.html b/src/digimarks/templates/user_index.html index b3f1eb7..530bc09 100644 --- a/src/digimarks/templates/user_index.html +++ b/src/digimarks/templates/user_index.html @@ -185,43 +185,46 @@ #} -
+