From 07f1106109a04b1e8b961dd1799ef3efba0618ce Mon Sep 17 00:00:00 2001 From: Aneks1 Date: Thu, 7 Mar 2024 17:02:46 -0500 Subject: [PATCH] beta0.8.2 --- src/components/NotePreview/NotePreview.vue | 20 +++++++++++++------- src/routes/HomePage/HomePage.vue | 14 ++++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/components/NotePreview/NotePreview.vue b/src/components/NotePreview/NotePreview.vue index b363707..feb3a37 100644 --- a/src/components/NotePreview/NotePreview.vue +++ b/src/components/NotePreview/NotePreview.vue @@ -49,18 +49,24 @@ export default defineComponent({ titleSize: 50 } }, - mounted() { - this.stateTitle = this.title - this.stateDesc = this.description - if(this.title.length > 25) this.stateTitle = this.title.slice(0, 22).trimEnd() + '...' - if(this.description.length > 50) this.stateDesc = this.description.slice(0, 47) + '...' - if(this.stateTitle.length > 7) this.titleSize = 50 - (this.stateTitle.length + 7) / 2 - if(this.stateTitle.length > 20) this.titleSize = 50 - (this.stateTitle.length + 10) / 2 + mounted() { this.handleFontSize() }, + watch: { + title: function() { this.handleFontSize() }, + description: function() { this.handleFontSize() } }, methods: { openMenu(id: string, e: MouseEvent) { console.log(id) console.log(e.clientX, e.clientY) + }, + handleFontSize() { + this.stateTitle = this.title + this.stateDesc = this.description + if(this.title.length > 25) this.stateTitle = this.title.slice(0, 22).trimEnd() + '...' + if(this.description.length > 50) this.stateDesc = this.description.slice(0, 47) + '...' + if(this.stateTitle.length > 7) this.titleSize = 50 - (this.stateTitle.length + 7) / 2 + if(this.stateTitle.length > 20) this.titleSize = 50 - (this.stateTitle.length + 10) / 2 + console.log(this.stateTitle) } } }) diff --git a/src/routes/HomePage/HomePage.vue b/src/routes/HomePage/HomePage.vue index b9e5d2c..51ad294 100644 --- a/src/routes/HomePage/HomePage.vue +++ b/src/routes/HomePage/HomePage.vue @@ -107,7 +107,9 @@ export default defineComponent({ watch: { currentBoard: function() { if(this.currentBoard == null) return + this.loadedNotes = [] this.loadedNotes = Array.from(boardManager.boards.get(this.currentBoard)!.notes).map(x => x[1]) + console.log(boardManager.boards.get(this.currentBoard)!.notes) } }, methods: { @@ -154,12 +156,12 @@ export default defineComponent({ resizeNoteDisplay() { // currently fixing - const winWidth = remote.getCurrentWindow().getBounds().width - const menuWidth = 16*16 - const noteWidth = 13*16 - const contWidth = winWidth - menuWidth - 6*16 - const noteCount = Math.floor(contWidth / noteWidth) - this.homeContainer.gap = (contWidth - noteCount*noteWidth) / (noteCount - 1) - 3 + // const winWidth = remote.getCurrentWindow().getBounds().width + // const menuWidth = 16*16 + // const noteWidth = 13*16 + // const contWidth = winWidth - menuWidth - 6*16 + // const noteCount = Math.floor(contWidth / noteWidth) + // this.homeContainer.gap = (contWidth - noteCount*noteWidth) / (noteCount - 1) - 3 } }, mounted() {