Bladeren bron

fix links title

axolotle 2 jaren geleden
bovenliggende
commit
5840bda7cc
1 gewijzigde bestanden met toevoegingen van 7 en 1 verwijderingen
  1. 7 1
      src/components/nodes/NodeViewBody.vue

+ 7 - 1
src/components/nodes/NodeViewBody.vue

@@ -60,7 +60,7 @@
           <div class="footnote-child-list" v-if="note.links">
             <node-view-title
               v-for="link in note.links" :key="link.id"
-              :node="link.type === 'prod' && link.parents && link.parents.length ? link.parents[0] : link"
+              :node="getLinkObj(link)"
               link
               @open-node="onFootnoteLinkClick(link, `note-${node.id}-${note.number}`)"
             >
@@ -105,6 +105,12 @@ export default {
   },
 
   methods: {
+    getLinkObj (link) {
+      if (link.preTitle || link.italTitle) return link
+      if (link.type === 'prod' && link.parents && link.parents.length) return link.parents[0]
+      return link
+    },
+
     addFootnotes () {
       const links = this.$el.querySelectorAll('a')
       links.forEach((link, i) => {