🐛 (breadcrump) back to home on click
This commit is contained in:
@@ -115,7 +115,7 @@ export default defineComponent({
|
|||||||
stackedNotes,
|
stackedNotes,
|
||||||
resetStackedNotes,
|
resetStackedNotes,
|
||||||
userSettings: computed(() => store.userSettings),
|
userSettings: computed(() => store.userSettings),
|
||||||
focus: () => scrollToFocusedNote(),
|
focus: () => scrollToFocusedNote(undefined, true),
|
||||||
...noteProps
|
...noteProps
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,16 @@ export const useFocus = () => {
|
|||||||
const { scrollToNote, isMobile } = useOverlay(false)
|
const { scrollToNote, isMobile } = useOverlay(false)
|
||||||
const { stackedNotes } = useQueryStackedNotes()
|
const { stackedNotes } = useQueryStackedNotes()
|
||||||
|
|
||||||
const scrollToFocusedNote = (sha?: string) => {
|
const scrollToFocusedNote = (sha?: string, backToTop?: boolean) => {
|
||||||
if (!sha) {
|
if (!sha) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (backToTop) {
|
||||||
|
scrollToNote(0)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
const index = stackedNotes.value.findIndex((noteSHA) => noteSHA === sha)
|
const index = stackedNotes.value.findIndex((noteSHA) => noteSHA === sha)
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ export const useLinks = (className: string, sha?: string) => {
|
|||||||
const target = event.target as HTMLElement
|
const target = event.target as HTMLElement
|
||||||
const href = target.getAttribute('href')
|
const href = target.getAttribute('href')
|
||||||
|
|
||||||
|
console.log(target, href)
|
||||||
|
|
||||||
if (!href) {
|
if (!href) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user