add DotButton hover text pos

This commit is contained in:
axolotle
2021-06-30 12:53:54 +02:00
parent a4b0f6e2f2
commit f53bae6541
2 changed files with 24 additions and 4 deletions
+9 -1
View File
@@ -2,7 +2,7 @@
<nav class="node-view-child-list" :class="{ 'smartphone': smartphone }">
<ul>
<li
v-for="child in children" :key="child.id"
v-for="(child, i) in children" :key="child.id"
class="node-view-child-list-item"
>
<dot-button
@@ -10,6 +10,7 @@
:variant="child.variant"
:active="activeNodes.includes(child.id)"
dot-only
:pos="smartphone ? getDir(i) : 'left'"
>
{{ $t('variants.' + child.variant) }}
</dot-button>
@@ -40,6 +41,13 @@ export default {
},
methods: {
getDir (index) {
const len = this.children.length
if (index === 0) return 'right'
if (index === this.children.length - 1) return 'left'
return 'middle'
},
onOpen (childId) {
this.$emit('open-child', { childId })
}