From 1f24313d236fb9782701464319aa1090158488ae Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 7 Nov 2023 00:44:55 +0000 Subject: [PATCH] Bugfixes on tooltip z-indexing. Search using breadcrumbs in table. Link fixes. --- cista-front/src/assets/main.css | 6 +- cista-front/src/components/BreadCrumb.vue | 25 +-- cista-front/src/components/FileExplorer.vue | 183 +++++++++++--------- cista-front/src/components/HeaderMain.vue | 9 +- cista-front/src/repositories/Document.ts | 2 +- cista-front/src/stores/documents.ts | 27 ++- cista-front/src/views/ExplorerView.vue | 37 +++- 7 files changed, 166 insertions(+), 123 deletions(-) diff --git a/cista-front/src/assets/main.css b/cista-front/src/assets/main.css index 2d1719e..d1348b6 100644 --- a/cista-front/src/assets/main.css +++ b/cista-front/src/assets/main.css @@ -187,10 +187,10 @@ table { display: flex; flex-direction: column; } -nav { +header nav.headermain { /* Position so that tooltips can appear on top of other positioned elements */ position: relative; - z-index: 10; + z-index: 100; } main { height: calc(100svh - var(--header-height)); @@ -198,7 +198,7 @@ main { overflow-y: scroll; } [data-tooltip]:hover:after { - z-index: 1000; + z-index: 101; content: attr(data-tooltip); position: absolute; font-size: 1rem; diff --git a/cista-front/src/components/BreadCrumb.vue b/cista-front/src/components/BreadCrumb.vue index 0573c41..addac26 100644 --- a/cista-front/src/components/BreadCrumb.vue +++ b/cista-front/src/components/BreadCrumb.vue @@ -41,19 +41,12 @@ const props = defineProps<{ const longest = ref>([]) -watchEffect(() => { - const longcut = longest.value.slice(0, props.path.length) - const same = longcut.every((value, index) => value === props.path[index]) - if (!same) longest.value = props.path - else if (props.path.length > longcut.length) { - longest.value = longcut.concat(props.path.slice(longcut.length)) - } -}) - const isCurrent = (index: number) => index == props.path.length ? 'location' : undefined const navigate = (index: number) => { - links[index].focus() + const link = links[index] + if (!link) throw Error(`No link at index ${index} (path: ${props.path})`) + link.focus() router.replace(`/${longest.value.slice(0, index).join('/')}`) } @@ -62,6 +55,18 @@ const move = (dir: number) => { if (index < 0 || index > longest.value.length) return navigate(index) } + +watchEffect(() => { + const longcut = longest.value.slice(0, props.path.length) + const same = longcut.every((value, index) => value === props.path[index]) + if (!same) longest.value = props.path + else if (props.path.length > longcut.length) { + longest.value = longcut.concat(props.path.slice(longcut.length)) + } +}) +watchEffect(() => { + if (links.length) navigate(props.path.length) +}) diff --git a/cista-front/src/components/HeaderMain.vue b/cista-front/src/components/HeaderMain.vue index 1461b69..ca74837 100644 --- a/cista-front/src/components/HeaderMain.vue +++ b/cista-front/src/components/HeaderMain.vue @@ -12,22 +12,17 @@ const toggleSearchInput = () => { nextTick(() => { const input = search.value if (input) input.focus() - else if (searchButton.value) searchButton.value.blur() - executeSearch() + //else if (searchButton.value) document.querySelector('.breadcrumb')!.focus() }) } -const executeSearch = () => { - documentStore.setFilter(search.value?.value ?? '') -} - defineExpose({ toggleSearchInput })