diff --git a/src/components/globals/DotButton.vue b/src/components/globals/DotButton.vue index e557270..c8ff021 100644 --- a/src/components/globals/DotButton.vue +++ b/src/components/globals/DotButton.vue @@ -5,10 +5,10 @@ v-bind="$attrs" v-on="$listeners" :active="active" :variant="variant" - @mouseover="show = true" - @mouseleave="show = false" - @focus="show = true" - @blur="show = false" + @mouseover="updateShow(true)" + @mouseleave="updateShow(false)" + @focus="updateShow(true)" + @blur="updateShow(false)" @click="onClick" > @@ -38,6 +38,10 @@ export default { methods: { onClick (e) { this.$el.blur() + }, + + updateShow (show) { + this.show = this.hovered || show } } } diff --git a/src/components/layouts/PageView.vue b/src/components/layouts/PageView.vue index 76aac71..9b39bad 100644 --- a/src/components/layouts/PageView.vue +++ b/src/components/layouts/PageView.vue @@ -26,7 +26,7 @@ {{ $t('variants.' + link.variant) }} @@ -106,7 +106,13 @@ export default { mounted () { if (this.page.notes) { const ids = this.page.notes.filter(note => (note.links)).reduce((ids, note) => { - return [...ids, ...note.links.map(link => link.id)] + note.links.forEach((link) => { + ids.push(link.id) + if (link.parents && link.parents.length) { + ids.push(link.parents[0].id) + } + }) + return ids }, []) this.$store.dispatch('GET_NODES', { ids, dataLevel: 'initial' }) this.addFootnotes() diff --git a/src/components/nodes/NodeViewBody.vue b/src/components/nodes/NodeViewBody.vue index 4e3686d..019177e 100644 --- a/src/components/nodes/NodeViewBody.vue +++ b/src/components/nodes/NodeViewBody.vue @@ -67,7 +67,7 @@ {{ $t('variants.' + link.variant) }} @@ -173,7 +173,13 @@ export default { if (this.mode === 'view' && this.node.notes) { // Query partial data for linked nodes in notes const ids = this.node.notes.filter(note => (note.links)).reduce((ids, note) => { - return [...ids, ...note.links.map(link => link.id)] + note.links.forEach((link) => { + ids.push(link.id) + if (link.parents && link.parents.length) { + ids.push(link.parents[0].id) + } + }) + return ids }, []) this.$store.dispatch('GET_NODES', { ids, dataLevel: 'initial' }) } diff --git a/src/store/modules/pages.js b/src/store/modules/pages.js index 17b641e..0321db0 100644 --- a/src/store/modules/pages.js +++ b/src/store/modules/pages.js @@ -52,6 +52,7 @@ export default { async 'QUERY_PAGE_BY_ID' ({ state, commit, dispatch, getters }, id) { if (state.pages[id] !== undefined) return state.pages[id] return api.query(Page, { id }).then(data => { + dispatch('PARSE_PAGE', data.page) commit('SET_PAGE_FROM_ID', { id, page: data.page }) return state.pages[id] })