(scroll) scroll on title click

This commit is contained in:
Julien Calixte
2021-03-14 21:51:38 +01:00
parent d624e064af
commit 0172ac5be3
3 changed files with 35 additions and 10 deletions

View File

@@ -61,7 +61,7 @@ export const useNote = (
}, {})
)
const unsubscribe = noteEventBus.addEventBusListener(
const unsubscribeLink = noteEventBus.addEventBusListener(
({ path, currentNoteSHA }) => {
const currentFile = tree.value.find((file) => file.sha === currentNoteSHA)
@@ -76,7 +76,7 @@ export const useNote = (
const file = tree.value.find((file) => file.path === finalPath)
if (!file?.sha || stackedNotes.value.includes(file.sha)) {
scrollToFocusedNote(stackedNotes.value, file?.sha)
scrollToFocusedNote(file?.sha, stackedNotes.value)
return
}
@@ -115,7 +115,7 @@ export const useNote = (
stackedNotes.value = newStackedNotes
scrollToFocusedNote(stackedNotes.value, file.sha)
scrollToFocusedNote(file.sha, stackedNotes.value)
}
)
@@ -140,7 +140,7 @@ export const useNote = (
})
onUnmounted(() => {
unsubscribe()
unsubscribeLink()
})
watch(stackedNotes, resizeContainer, {