better semantic markup
This commit is contained in:
parent
82581b93b8
commit
0cd0e62493
3 changed files with 24 additions and 21 deletions
|
|
@ -192,10 +192,17 @@ export default {
|
||||||
const lastStatus = computed(
|
const lastStatus = computed(
|
||||||
() => conversation.value[conversation.value.legnth - 1],
|
() => conversation.value[conversation.value.legnth - 1],
|
||||||
)
|
)
|
||||||
const getStatusClasses = (status, active) => ({
|
const getStatusClasses = (status, ancestor) => {
|
||||||
'-first': status.id === firstStatus.value?.id,
|
const result = {
|
||||||
'-last': status.id === lastStatus.value?.id,
|
'-first': status.id === firstStatus.value?.id,
|
||||||
})
|
'-last': status.id === lastStatus.value?.id,
|
||||||
|
}
|
||||||
|
if (ancestor) {
|
||||||
|
result['-ancestor'] = true
|
||||||
|
result['-fade'] = mergedConfig.value.conversationTreeFadeAncestors
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
const { fontSize } = useInterfaceSizes()
|
const { fontSize } = useInterfaceSizes()
|
||||||
|
|
||||||
|
|
@ -306,9 +313,6 @@ export default {
|
||||||
const shouldShowAncestors = computed(
|
const shouldShowAncestors = computed(
|
||||||
() => isExpanded.value && heightChartAncestors.value.length > 0,
|
() => isExpanded.value && heightChartAncestors.value.length > 0,
|
||||||
)
|
)
|
||||||
const shouldFadeAncestors = computed(
|
|
||||||
() => mergedConfig.value.conversationTreeFadeAncestors,
|
|
||||||
)
|
|
||||||
|
|
||||||
// # Scrolling
|
// # Scrolling
|
||||||
const diveIntoStatus = (id) => tryScrollTo(id)
|
const diveIntoStatus = (id) => tryScrollTo(id)
|
||||||
|
|
@ -366,7 +370,6 @@ export default {
|
||||||
treeViewIsSimple,
|
treeViewIsSimple,
|
||||||
shouldShowAllConversationButton,
|
shouldShowAllConversationButton,
|
||||||
shouldShowAncestors,
|
shouldShowAncestors,
|
||||||
shouldFadeAncestors,
|
|
||||||
|
|
||||||
// # Scrolling
|
// # Scrolling
|
||||||
diveToTopLevel,
|
diveToTopLevel,
|
||||||
|
|
|
||||||
|
|
@ -91,15 +91,14 @@
|
||||||
ref="ancestors"
|
ref="ancestors"
|
||||||
class="thread-ancestors"
|
class="thread-ancestors"
|
||||||
>
|
>
|
||||||
<article
|
<template
|
||||||
v-for="element in heightChartAncestors"
|
v-for="element in heightChartAncestors"
|
||||||
class="thread-ancestor"
|
:key="element.id"
|
||||||
:class="{'thread-ancestor-has-other-replies': getReplies(element.id).size > 1, '-faded': shouldFadeAncestors}"
|
|
||||||
>
|
>
|
||||||
<Status
|
<Status
|
||||||
v-if="element.type === 'item'"
|
v-if="element.type === 'item'"
|
||||||
class="conversation-status panel-body"
|
class="conversation-status panel-body"
|
||||||
:class="getStatusClasses(element.item)"
|
:class="getStatusClasses(element.item, true)"
|
||||||
|
|
||||||
:status-id="element.item.id"
|
:status-id="element.item.id"
|
||||||
:replies="getReplies(element.item.id)"
|
:replies="getReplies(element.item.id)"
|
||||||
|
|
@ -119,8 +118,9 @@
|
||||||
v-if="element.type === 'spacer'"
|
v-if="element.type === 'spacer'"
|
||||||
class="virtual-spacer"
|
class="virtual-spacer"
|
||||||
:style="{ height: element.height + 'px' }"
|
:style="{ height: element.height + 'px' }"
|
||||||
|
aria-hidden="true"
|
||||||
/>
|
/>
|
||||||
</article>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<ThreadTree
|
<ThreadTree
|
||||||
:status-id="currentStatus.id"
|
:status-id="currentStatus.id"
|
||||||
|
|
@ -138,14 +138,13 @@
|
||||||
ref="linear"
|
ref="linear"
|
||||||
class="thread-body"
|
class="thread-body"
|
||||||
>
|
>
|
||||||
<article
|
<template
|
||||||
v-for="element in heightChartLinear"
|
v-for="element in heightChartLinear"
|
||||||
class="panel-body"
|
:key="element.id"
|
||||||
:key="element.id ?? element.ids"
|
|
||||||
>
|
>
|
||||||
<Status
|
<Status
|
||||||
v-if="element.type === 'item'"
|
v-if="element.type === 'item'"
|
||||||
class="conversation-status"
|
class="panel-body conversation-status"
|
||||||
:class="getStatusClasses(element.item)"
|
:class="getStatusClasses(element.item)"
|
||||||
:status-id="element.item.id"
|
:status-id="element.item.id"
|
||||||
:replies="getReplies(element.item.id)"
|
:replies="getReplies(element.item.id)"
|
||||||
|
|
@ -163,10 +162,11 @@
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-if="element.type === 'spacer'"
|
v-if="element.type === 'spacer'"
|
||||||
class="virtual-spacer"
|
aria-hidden="true"
|
||||||
|
class="panel-body virtual-spacer"
|
||||||
:style="{ height: element.height + 'px' }"
|
:style="{ height: element.height + 'px' }"
|
||||||
/>
|
/>
|
||||||
</article>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<article
|
||||||
v-if="!hideStatus"
|
v-if="!hideStatus"
|
||||||
ref="root"
|
ref="root"
|
||||||
class="Status"
|
class="Status"
|
||||||
|
|
@ -568,7 +568,7 @@
|
||||||
</template>
|
</template>
|
||||||
</i18n-t>
|
</i18n-t>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./status.js"></script>
|
<script src="./status.js"></script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue