diff --git a/src/components/nodes/NodeViewHeaderRef.vue b/src/components/nodes/NodeViewHeaderRef.vue
index e550590..98d92c2 100644
--- a/src/components/nodes/NodeViewHeaderRef.vue
+++ b/src/components/nodes/NodeViewHeaderRef.vue
@@ -7,7 +7,7 @@
{{ toCommaList(node.authors) }},
-
+
{{ node.edition.map(ed => ed.name).join(' ') }}
diff --git a/src/pages/library/LibraryTree.vue b/src/pages/library/LibraryTree.vue
index 9c8c149..38136ec 100644
--- a/src/pages/library/LibraryTree.vue
+++ b/src/pages/library/LibraryTree.vue
@@ -1,35 +1,112 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('variants.' + activeNode.data.variant) }}
+
+ {{ toCommaList(activeNode.data.authors) }},
+
+
+
+
+
+
diff --git a/src/store/modules/library.js b/src/store/modules/library.js
index 0ac7d6b..727e08e 100644
--- a/src/store/modules/library.js
+++ b/src/store/modules/library.js
@@ -177,7 +177,7 @@ export default {
})
},
- activeNodes: (state) => {
+ activeNodes: state => {
if (!state.nodebook) return []
return state.nodebook.reduce((acc, ids) => [...acc, ...ids], [])
},
@@ -218,8 +218,7 @@ export default {
},
nodeTree: (state, rootState) => {
- if (state.nodeDepartId === undefined) return
- return state.trees[state.nodeDepartId]
+ return state.trees[state.nodeDepartId] || { nodes: [], links: [] }
}
}
}
diff --git a/src/store/utils.js b/src/store/utils.js
index ec72ffc..50117b0 100644
--- a/src/store/utils.js
+++ b/src/store/utils.js
@@ -92,6 +92,8 @@ export function buildTree (treeData, nodesData) {
if (!uniqueIds.includes(node.id)) {
uniqueIds.push(node.id)
node.data = nodesData.find(n => n.id === node.id)
+ // Add `x` and `y` keys so Vue can update on these values updates
+ Object.assign(node, { x: undefined, y: undefined })
nodes.push(node)
if (node.children) {
node.children.forEach(child => {