From ece64f48bef291380600adfa9da41e1e1eaa27d8 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 7 Nov 2023 01:26:41 +0000 Subject: [PATCH] Cleanup, TS errors but it compiles and works... --- cista-front/src/App.vue | 16 ++++++------ cista-front/src/assets/main.css | 2 +- cista-front/src/components/FileExplorer.vue | 25 ++++++++++--------- .../src/components/FileRenameInput.vue | 6 ++--- cista-front/src/components/HeaderMain.vue | 1 + cista-front/src/repositories/Document.ts | 5 ++-- cista-front/src/stores/documents.ts | 20 +++------------ 7 files changed, 32 insertions(+), 43 deletions(-) diff --git a/cista-front/src/App.vue b/cista-front/src/App.vue index a7b5614..b4b7c64 100644 --- a/cista-front/src/App.vue +++ b/cista-front/src/App.vue @@ -62,7 +62,9 @@ const headerMain = ref(null) let vert = 0 let timer: any = null const globalShortcutHandler = (event: KeyboardEvent) => { - const c = documentStore.fileExplorer.isCursor() + const fileExplorer = documentStore.fileExplorer as any + if (!fileExplorer) return + const c = fileExplorer.isCursor() const keyup = event.type === 'keyup' if (event.repeat) { if ( @@ -84,7 +86,7 @@ const globalShortcutHandler = (event: KeyboardEvent) => { } // Select all (toggle); keydown to prevent builtin else if (!keyup && event.key === 'a' && (event.ctrlKey || event.metaKey)) { - documentStore.fileExplorer.toggleSelectAll() + fileExplorer.toggleSelectAll() } // Keys 1-3 to sort columns else if ( @@ -92,16 +94,16 @@ const globalShortcutHandler = (event: KeyboardEvent) => { keyup && (event.key === '1' || event.key === '2' || event.key === '3') ) { - documentStore.fileExplorer.toggleSortColumn(+event.key) + fileExplorer.toggleSortColumn(+event.key) } // Rename else if (c && keyup && !event.ctrlKey && (event.key === 'F2' || event.key === 'r')) { - documentStore.fileExplorer.cursorRename() + fileExplorer.cursorRename() } // Toggle selections on file explorer; ignore all spaces to prevent scrolling built-in hotkey else if (c && event.code === 'Space') { if (keyup && !event.altKey && !event.ctrlKey) - documentStore.fileExplorer.cursorSelect() + fileExplorer.cursorSelect() } else return event.preventDefault() if (!vert) { @@ -114,13 +116,13 @@ const globalShortcutHandler = (event: KeyboardEvent) => { if (!timer) { // Initial move, then t0 delay until repeats at tr intervals const select = event.shiftKey - documentStore.fileExplorer.cursorMove(vert, select) + fileExplorer.cursorMove(vert, select) const t0 = 200, tr = 30 timer = setTimeout( () => (timer = setInterval(() => { - documentStore.fileExplorer.cursorMove(vert, select) + fileExplorer.cursorMove(vert, select) }, tr)), t0 - tr ) diff --git a/cista-front/src/assets/main.css b/cista-front/src/assets/main.css index d1348b6..98a2a24 100644 --- a/cista-front/src/assets/main.css +++ b/cista-front/src/assets/main.css @@ -35,7 +35,7 @@ justify-content: space-between; align-items: end; } - .breadcrumb { + header .breadcrumb { font-size: 1.7em; flex-shrink: 10; } diff --git a/cista-front/src/components/FileExplorer.vue b/cista-front/src/components/FileExplorer.vue index 679abe6..25a2d23 100644 --- a/cista-front/src/components/FileExplorer.vue +++ b/cista-front/src/components/FileExplorer.vue @@ -57,7 +57,7 @@