reset stacked note on click
This commit is contained in:
@@ -100,14 +100,14 @@ const focusREADME = () => scrollToTop()
|
|||||||
</div>
|
</div>
|
||||||
<div class="repo-title">
|
<div class="repo-title">
|
||||||
<h1 class="title is-1">
|
<h1 class="title is-1">
|
||||||
[<router-link
|
<router-link
|
||||||
:to="{ name: 'FluxNoteView', params: { user, repo } }"
|
:to="{ name: 'FluxNoteView', params: { user, repo } }"
|
||||||
@click="resetStackedNotes"
|
@click="resetStackedNotes"
|
||||||
>
|
>
|
||||||
{{ repo }} </router-link
|
{{ repo }}
|
||||||
>]
|
</router-link>
|
||||||
</h1>
|
</h1>
|
||||||
<h4 class="subtitle is-4">
|
<h4 class="subtitle is-5">
|
||||||
<em>{{ user }}</em> -
|
<em>{{ user }}</em> -
|
||||||
<img
|
<img
|
||||||
v-show="store.isReadmeOffline"
|
v-show="store.isReadmeOffline"
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const useQueryStackedNotes = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const initResetStackedNote = () => {
|
const resetStackedNotes = () => {
|
||||||
stackedNotes.value = Array.isArray(query.stackedNotes)
|
stackedNotes.value = Array.isArray(query.stackedNotes)
|
||||||
? (query.stackedNotes as string[])
|
? (query.stackedNotes as string[])
|
||||||
: ([query.stackedNotes]
|
: ([query.stackedNotes]
|
||||||
@@ -45,7 +45,7 @@ export const useQueryStackedNotes = () => {
|
|||||||
|
|
||||||
if (initial) {
|
if (initial) {
|
||||||
initial = false
|
initial = false
|
||||||
initResetStackedNote()
|
resetStackedNotes()
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateQueryStackedNotes = (newStackedNotes: string[]) =>
|
const updateQueryStackedNotes = (newStackedNotes: string[]) =>
|
||||||
@@ -98,7 +98,7 @@ export const useQueryStackedNotes = () => {
|
|||||||
stackedNotes: readonly(stackedNotes),
|
stackedNotes: readonly(stackedNotes),
|
||||||
updateQueryStackedNotes,
|
updateQueryStackedNotes,
|
||||||
addStackedNote,
|
addStackedNote,
|
||||||
resetStackedNotes: () => initResetStackedNote(),
|
resetStackedNotes,
|
||||||
scrollToFocusedNote,
|
scrollToFocusedNote,
|
||||||
scrollToTop: () => scrollToNote(0)
|
scrollToTop: () => scrollToNote(0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ export const useUserRepoStore = defineStore({
|
|||||||
this.files = files
|
this.files = files
|
||||||
|
|
||||||
// if the offline state is too quick,
|
// if the offline state is too quick,
|
||||||
// it gives more the impression of
|
// it gives more the impression of glitch.
|
||||||
// glitch.
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.isReadmeOffline = false
|
this.isReadmeOffline = false
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|||||||
Reference in New Issue
Block a user