Skip to content

Commit

Permalink
Allow to truncate notation
Browse files Browse the repository at this point in the history
See #46 for discussion and additional ideas.
  • Loading branch information
nichtich committed Jan 24, 2022
1 parent 52f4ce8 commit be92a34
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/Analyze.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
<div class="hierarchy-info">
<tippy
v-if="isMemberParentOf(result.memberList[i - 1], member)"
content="This DDC class is a child of the previous class.">
content="This DDC class is a child of the previous class. Click to truncate.">
<router-link :to="`/?notation=${truncatedNotation(notation, member)}`">
</router-link>
</tippy>
</div>
<div class="notation-part">
Expand Down Expand Up @@ -242,6 +244,10 @@ export default {
notationPlugin,
languages,
language,
truncatedNotation(notation, member) {
const length = member.notation[1].replace(/-+$/,'').length
return notation.substr(0, length).replace(/[.]$/,'')
}
}
},
}
Expand Down

0 comments on commit be92a34

Please sign in to comment.